VinciBot Python Lesson 5: Square Path + Obstacle RGB LED (for/while, if/else)

2 days ago
3

In this fifth lesson we pull everything together with a hands-on VinciBot project.
We first repeat a square path (move forward then turn left ×4) to review for loops and structure.
Then we build a simple while True monitor that uses sensors.is_obstacle_distance('<', 50) to detect an object and light the RGB LEDs (blue) via leds.show_all(R, G, B).
Along the way we reinforce indentation, comments, and when to choose for vs while.

Perfect for late-elementary to middle-school learners getting comfortable with Python and robotics.

Chapters:
00:00 Recap (functions vs methods, for/while, if/else)
01:20 Project overview
02:30 Repeating actions with for
04:10 Converting to while logic
06:30 Obstacle sensing + RGB LEDs
08:40 Full run on VinciBot

Loading comments...