VinciBot Python #08: Global vs Local Variables & a Growing Triangle Robot Drawing

10 hours ago
2

In this lesson, we use VinciBot to draw a triangle whose side length grows each time it moves (start at 3 cm, then +2 cm each edge). Along the way, you’ll learn:

What variables are and how to initialize/update them

The difference between global and local variables (and when to use global)

How decorators trigger code with @event.button_triangle_pressed

Using for loops, increment steps, move_position, and move_angle to control the robot

If you’ve used Scratch/block coding, you’ll see the parallels in Python—same ideas, just code! Try it with your VinciBot and tweak the growth step to make your own patterns.

Hashtags
#VinciBot #Python #Robotics #STEM #CodingForKids #BeginnerPython #PythonBasics #GlobalVariables #LocalVariables #Decorator #EventDriven #ForLoop #Loops #Increment #Triangle #RobotDrawing #RobotCoding #EducationalRobotics #BlockCoding #Scratch #move_position #move_angle #MakerEducation #CodingEducation #EdTech

Loading comments...