Activity: Driving Shapes

Learn to make your rover move and draw shapes with it. Start by making the rover drive in a square, then a triangle. Simplify your code with a loop and create more complex shapes like hexagons and octagons.

Relevant Coding Skills

Iteration

Relevant Rover Concepts

Motors

Activity Demonstration

Setup

All you need is a flat, uniform surface to drive on. Different surfaces have different friction properties. This means the tracks will slip differently dependent on where the rover is driving. Some movement blocks such as turn by degrees are calibrated for an average friction. When driving on other surfaces you may need to turn more or less to get the desired angle.

 

Here’s Our Approach

Stage 1

Use the basic movement blocks to program the rover to go forward then turn. Using the turn by degree blocks makes it easier to alter the code for other shapes.

Stage 2

Use a repeat loop block and change the number to the number of sides in your shape. Place your movement blocks inside the repeat.

Stage 3

To draw different shapes, change the number of times the loop repeats and the number of degrees in a turn.

Example Code

Example Code

 

Related Posts

Previous
Previous

Activity: Stop On Colour Change