Variables and Functions for Robots
Step through programs and watch memory boxes and function calls change, see why named values beat magic numbers, write forward(cm) and polygon(), then calibrate Spark and keep its warehouse round working as the battery runs down.
- From Blocks to Python: Watch blocks turn into Python line by line, see indentation change what a program does, and decode real error messages. Then type Spark’s programs, including a square with a for loop, and debug four gadgets in Python.
- Distance Sensors: Watch an ultrasonic echo become a distance, scan a playroom with sonar and laser, print readings to a serial monitor, then make Spark stop at any wall, beep like a parking sensor, find the way out of a room and follow a person.