1 of 14

Programming 201 – SPIKE Prime - Word Blocks

September 28, 2025

2 of 14

Software Download

Page 2

3 of 14

Areas to be covered in this session are…

    • 2-Stage Line Following
    • Square on a line
    • Variables
    • MyBlocks (Time Permitting)

Page 3

4 of 14

How Does Light Sensor Work?

Page 4

    • The white LED projects light down on the mat.

    • The photoresistor converts the reflected light energy into electrical impulses which are sent to the Spike Prime Hub.

    • The hub converts the electrical signal from the sensor into numbers ranging from 0 to 100.

    • When the LED shines down on white, the reading should be a high number, close to 100. And when it shines on black, the reading should be a low number, close to 0.

    • Black absorbs the most light and white reflects the most light.

5 of 14

Light Sensor Readings

Page 5

6 of 14

Two-Stage Line Following

  • What is Line Following?
  • Why do we use it?
  • What is 2 Stage?

Page 6

7 of 14

Two-Stage Line Following

Page 7

  • The robot zigzags right and left – never in a straight line. Causing jerky movement.

  • In 2-stage line following, the only two commands are sharp right and sharp left turns.

  • 50 is the threshold:
    • > 50 is considered to be white
    • < 50 is considered to be black

  • For example:
    • Go right at white when reflected light intensity is > 50
    • Go left at black when reflected light intensity < 50

8 of 14

Our Robot

Page 8

Motor D

Motor E

Light Sensor B

Light Sensor A

9 of 14

Program It!

Page 9

10 of 14

Square Up

  • What is square up?
  • Why do we use it?

Page 10

11 of 14

Squaring Up To A Black Line

Page 11

  • The robot goes back and forth at a decreasing speed based on light sensor values to align the robot perpendicular to a line.

  • 50 is the threshold value:
    • > 50 is considered to be white
    • < 50 is considered to be black

  • For example:
    • Go forwards at white when reflected light intensity is > 50
    • Go backwards at black when reflected light intensity < 50

12 of 14

Program It!

Page 12

13 of 14

Page 13

14 of 14

Thank You For Attending

Page 14

  • If you would like to learn more, please attend the SPIKE Prime 301 seminar for more advanced programing skills (And lollipops)

  • Check out our Ctrl-Z team website here: