Learn how to make your Rover move and draw shapes. Start by making it drive in a square, then a triangle. Simplify your code with a loop and create more complex shapes like hexagons and octagons.
Setup
All you need is a flat, uniform surface to drive on. Different surfaces have different friction properties, so the tracks will slip differently depending on where the Rover is driving. Some movement blocks (like Turn by Degrees) are calibrated for an average friction, on other surfaces you may need to turn more or less to get the desired angle.
Our Approach
Stage 1: Forward and Turn
Use the basic movement blocks to program the Rover to go forward, then turn. Using the Turn by Degrees block makes it easier to alter the code for other shapes.
Stage 2: Loop the Sides
Use a Repeat loop block and set the number to the number of sides in your shape. Place your movement blocks inside the loop.
Stage 3: Make More Shapes
To draw different shapes, change the number of times the loop repeats and the number of degrees in each turn.

Example code, drawing shapes with a Repeat loop
Continue Learning
Related resourceActivity: Roaming RoverLearn to avoid obstacles with the ultrasonic sensor.


