The answersDownload the PDF
Worksheet

1.1 Your first move

Driving · Robot club · about 12 min

BugBotLab
NameClassDate

What this lesson is about

Drive, wait, stop, the LED, and the safety rule.

Questions 7 marks in all

  1. [1 mark]In this program, what keeps the robot driving for two seconds?

    led("green")
    forward(50)
    wait(2)
    stop()
    led("off")
    1. Await(2), because forward(50) returns straight away
    2. Bforward(50), because it drives for two seconds
    3. Cled("green")
    4. Dstop()
  2. [1 mark]What is the motion deadman?

    1. AThe robot stops itself if it hears nothing from the program for half a second
    2. BA button that switches the robot off
    3. CThe robot stops when it touches a wall
    4. DA command you must call at the end of every program
  3. [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.

  4. [1 mark]Which of these are true about how BugBot moves?

    Tick every answer that is true.

    1. AIt has no wheels
    2. BFour small motors vibrate its feet
    3. CIt can slide sideways without turning first
    4. DIt drives perfectly straight
    5. EEvery BugBot moves exactly the same
  5. [1 mark]Two programs both wait 2 seconds. One uses forward(20), the other forward(90). What is different?

    1. AThe forward(90) one goes much further
    2. BNothing, they both drive for 2 seconds
    3. CThe forward(20) one goes further
    4. DThe forward(90) one drives for longer
  6. [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.

    1. connect()
    2. backward(60)
    3. from bugbot import *
    4. wait(1)
    5. wait(2)
    6. stop()
    7. forward(60)
  7. [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?

    1. AA vibration drive never goes perfectly straight
    2. BA bug in the program
    3. CThe wait is too short
    4. Dbackward() is broken

The task: cross the line

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()

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/1-1-your-first-move/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Make the LED red while driving and green when stopped.
  2. Drive forward for 1 s, backward for 1 s, three times over, and print position() at the end.
  3. What is the slowest speed that still moves the robot? Try 10, 15, 20.