Skip to main content

Introduction

Our robot needs to do more than just move backwards and forwards if we are going to explore Mars - let's learn how to make it turn!

  1. Your robot should be setup in the same way as the previous section!
    • Your robot should be setup in the same way as the previous section!

    • Don't forget that the left motor should be plugged into M1, and the right motor into M2!

  2. Turning a car is easy - you can just rotate the wheels! However the wheels on most robots are fixed, so we have to do something different.
    • Turning a car is easy - you can just rotate the wheels!

    • However the wheels on most robots are fixed, so we have to do something different.

    • Fixed wheel machines steer using 'skid steering' - exactly the same way as a tank! You might have also seen small diggers that have 4 fixed wheels steering like this as well.

    • Skid steering is easy - you just increase or decrease the speed of one wheel, and the robot will turn!

  3. Load up your program from the previous session, and make sure it has the lines of code at the top that we always need.
    • Load up your program from the previous session, and make sure it has the lines of code at the top that we always need.

    • Then add the line of code in the picture, which will make both motors go forwards at 50%.

  4. Remember how the second number'' we give to the drive_motor function controls the speed'''?
    • Remember how the second number'' we give to the drive_motor function controls the speed'''?

    • Experiment with changing the speed of one motor and uploading the code to your robot. Which way do you think the robot will turn? How can you make it turn faster?

  5. Let's use what we've learned to pickup the stranded astronaut again.
    • Let's use what we've learned to pickup the stranded astronaut again.

    • This time, pickup the astronaut by driving your robot around the outside of the planet! Try and stay as close as you can to the edge.

    • Once you've picked up the astronaut, use a sleep()line and two more drive_motor functions, to make your robot reverse back around the planet and go back to where it started.

  6. You may have worked this out already, but we can actually make our robot spin on the spot if we want to!
    • You may have worked this out already, but we can actually make our robot spin on the spot if we want to!

    • Try making one motor go forwards at 100, and the other backwards at 100. Your robot should spin on the spot!

  7. Now we can turn the robot, let's pick up the astronaut by driving across the planet, but come back facing forwards!
    • Now we can turn the robot, let's pick up the astronaut by driving across the planet, but come back facing forwards!

    • Write a program to go and pick up the astronaut, turn on the spot and drive back to base going forwards.

Finish Line

Tech Camp

Member since: 10/03/2012

119 Guides authored

Team

Tech Camp Staff Member of Tech Camp Staff

6 Members

140 Guides authored