First Drive

SPIKE Prime Robotics Camp — Day 1

 

 

 

 

Teach your robot to move

The Camp

  1. First Drive (today!)
  2. Maze Runner
  3. Gyro Precision
  4. Obstacle Avoidance
  5. Line Following + Showcase

Each day upgrades our robot.

Today's Mission

Teach your robot to:

  • Drive a set distance
  • Turn a set angle
  • Trace a square

The robot does exactly what you tell it.

Rule of the Week

Bugs are data.

The robot did exactly what the code said.
What did the code actually say?

Human Robot

Give a teammate literal step commands to reach a target.

"Forward 2 steps… turn right… forward 1 step."

If they end up in the wrong spot — that's data!

Connect to Your Robot

  1. Open code.pybricks.com in Chrome or Edge
  2. Turn on your hub
  3. Click Connect and pick your hub's name

Blocks or Python?

  • Blocks — drag and drop
  • Python — type it out

Same robot, same ideas. Pybricks can show the Python next to your blocks.

Two Commands

Drive Straight


robot.straight(200)   # 200 millimeters forward
					

Distance is in millimeters. 1000 mm = 1 meter.

Turn


robot.turn(90)    # positive = right
robot.turn(-90)   # negative = left
					

Turning is in degrees.

Backward? Wrong way?

  • Drives backward → flip a motor Direction
  • Turns the wrong way → check the sign of your number

This is normal setup, not a broken robot.

Repeat: The for Loop

A square is the same two moves, four times.

Drive a Square


for i in range(4):
    robot.straight(300)
    robot.turn(90)
					

Predict it first, then run it!

Calibration

The numbers are guesses — you measure and adjust.

Fix the Distance

  1. Run robot.straight(1000)
  2. Measure how far it really went
  3. Too far → smaller wheel_diameter
    Too short → bigger wheel_diameter

Fix the Turn

  1. Run robot.turn(360)
  2. Did it spin exactly once?
  3. Adjust axle_track and try again

Tune distance first, then turning.

Energizer + Snack

Get up, move, refuel.

Keep food away from the kits and laptops!

Build It

Calibrate, then drive your square.

The Loop That Matters

  1. Predict
  2. Run
  3. Measure
  4. Adjust

"Pretty close" is a win today.

Demo + Wrap-Up

What We Learned

  • Distance in mm, angles in degrees
  • Positive turn = clockwise / right
  • for loops repeat moves
  • Calibrate: measure, then adjust

Coming Up Next

Maze Runner

We'll give our moves names
like forward_one_cell() and turn_right()
and string them together to solve a maze.

Questions?

Great driving!