Program Milo (with sensor)
Create (continued). This program drives Milo forward until the motion sensor detects the plant, then stops and plays a sound.
Prompts: what happens if you lower the stop distance? What if you remove the stop block? What if there's no plant?
Mission program. Milo drives forward at speed 5. When the sensor sees something close, Milo stops and makes a sound.
Put the plant (or your hand) about 20 cm in front of Milo, then press Play.
Your program
βΆ
β©5
β»
π<3
β
βͺ
Live sensor reading: β
What each block does
βΆ
Start the program.
β©5
Turn the motor on at speed 5. Milo starts driving.
β»
Choose which way Milo drives. Flip it to make him go backwards.
π<3
Wait until the sensor sees something close (number less than 3).
β
Stop the motor.
βͺ
Play a sound to say "I found it!"