In other languages

Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Turn Motor On for () Secs (block)

Archive.png
The subject of this article or section has changed dramatically and requires updating. Please keep in mind that some of the information or images may not be accurate or relevant to the current version of Scratch, the Scratch website, or the article subject. (October 2016)
Document.png Please expand this article or section. You can help by adding more information if you are an editor. More information might be found in a section of the talk page. (July 2017)
Turn Motor On for () Secs
2.0 Turn Motor On for () Secs.png
Category LEGO WeDo
Type Stack
Introduced in 1.4

The Turn Motor On for () Secs block is a LEGO WeDo block and a Stack block. The block activates a LEGO WeDo motor for the specified amount of seconds.

Prior to Scratch 2.0, this block was named Motor On for () Secs.

Example Uses

Instead of continuously turning on the motor, waiting a certain amount of seconds and turning it off, this block can be used.

Some common uses for the Turn Motor On for () Secs block:

  • Temporary motor movement

when gf clicked
turn [motor v] on for (2) secs

  • Controlling how far vehicles move

when gf clicked
turn [motor v] on for (0.5) secs

  • Keeping a fan on for a limited amount of time

when gf clicked
turn [motor v] on for (60) secs

  • Turning the fan on for a limited amount of time when (key) pressed

when [space v] key pressed
turn [motor v] on for (10) secs

Workaround

Main article: List of Block Workarounds

The block can be replicated with the following code:

turn [motor v] on
wait (number) secs
turn [motor v] off

See Also

  • This page was last modified on 31 August 2017, at 15:33.