Driving · Robot club · about 12 min
Drive, wait, stop, the LED, and the safety rule.
[1 mark]In this program, what keeps the robot driving for two seconds?
led("green")
forward(50)
wait(2)
stop()
led("off")wait(2), because forward(50) returns straight awayforward(50), because it drives for two secondsled("green")stop()forward(50) starts the robot and returns at once. The robot carries on while wait(2) lets two seconds pass.[1 mark]What is the motion deadman?
[1 mark]On the real robot, a program is just forward(50) then wait(2), with no stop(). About how many seconds after it starts do the motors switch off? Answer to one decimal place.
[1 mark]Which of these are true about how BugBot moves?
Tick every answer that is true.
[1 mark]Two programs both wait 2 seconds. One uses forward(20), the other forward(90). What is different?
[1 mark]Put these lines in order to drive forward for 1 second, then backward for 2 seconds, then stop.
Number the lines 1 to 7 to put them in the right order.
connect()backward(60)from bugbot import *wait(1)wait(2)stop()forward(60)from bugbot import * connect() forward(60) wait(1) backward(60) wait(2) stop()
Each drive command is followed by the wait that says how long it lasts. The motors go off at the end.
[1 mark]The robot drives forward 1.5 s and backward 1.5 s at the same speed, but the trail curves a little. What is the cause?
Drive from the start into the green zone and stop inside it, using only forward, wait and stop.
If it stops short, wait longer or go faster. The zone is big because on a real mat no two runs land in quite the same place.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() # drive forward at 50 (keeps going until the next command) forward(50) # pause 2 s (the robot keeps doing what it was told) wait(2) # all motors off stop()
The hint students can ask for: The green zone starts 40 cm ahead. Drive long enough, or fast enough, to get there and stop inside it.
from bugbot import * connect() forward(60) wait(4) stop()
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.