Turn Motor On for () Secs
turn [motor v] on for () seconds::wedo
Category LEGO WeDo
Type Stack
Introduced in 1.4

The Turn () 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. It was introduced in Scratch 1.4.

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

Example Uses

This block turns the motor on, waits the specified number of seconds, and turns the motor off.

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

  • Temporary motor movement

when gf clicked
turn [motor v] on for (2) seconds :: wedo

  • Controlling how far vehicles move

when gf clicked
turn [motor v] on for (0.5) seconds :: wedo

  • Keeping a fan on for a limited amount of time

when gf clicked
turn [motor v] on for (60) seconds :: wedo

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

when [space v] key pressed
turn [motor v] on for (10) seconds :: wedo

Workaround

Main article: List of Block Workarounds

The block can be replicated with the following code:

turn [motor v] on :: wedo
wait (number) seconds
turn [motor v] off :: wedo

See Also