Python7 tutorials

Projects with Python

Build complete Python projects that combine sensors, motors, and the display into real robots.

Distance Display

IntermediatePython

Build a polished live distance display using the onboard time-of-flight sensor and the OLED screen. Add a visual bar that grows and shrinks with distance, and colour-code the LED to give an at-a-glance range indicator.

DistanceToFOLEDDisplayProjectIntermediate

Motion Alarm in Python

AdvancedPython

Build a fully functional motion alarm. The buzzer frequency and LED colour escalate as an intruder gets closer — three alarm zones with distinct sounds and lights.

DistanceToFAlarmBuzzerLEDProjectAdvanced

Reaction Time Game

AdvancedPython

Build a reaction time game in Python. A random delay ends when the GRN LED lights — press Switch A as fast as you can! Your reaction time is measured in milliseconds using `time.ticks_ms()` and displayed on the OLED.

TimingRandomSwitchesOLEDGameProjectAdvanced

Line Follower in Python

AdvancedPython

Program a line-following robot in Python. Read both TCRT5000 sensors, classify the robot's position relative to the line, and steer the motors accordingly — four states, clean functions, smooth following.

Line SensorMotorsSteeringRobotFunctionsProjectAdvanced

Robot Dance

AdvancedPython

Choreograph a full robot performance combining motor moves, LED lights, and buzzer music. Store the dance as a list of scripted moves and play them in sync with a melody.

MotorsLEDBuzzerChoreographyListsFunctionsProjectAdvanced

Sound + Light Show in Python

IntermediatePython

Choreograph a light and sound show in Python using all three LEDs and the buzzer. Write a reusable beat function, script a sequence, then loop it forever.

LEDBuzzerSequenceTimingPythonProjectIntermediate

Obstacle Avoider in Python

AdvancedPython

Program your robot to navigate a room on its own in Python. It drives forward until the distance sensor detects an obstacle, then reverses and turns to find a clear path.

DistanceToFMotorsAutonomousRobotPythonProjectAdvanced