Skip to main content

Introduction

You are the chief programmer for a mission to Mars that has crash landed, and one of your crew is stranded on the other side of the planet! Let's learn how to make our robot move so we can save them.

  1. Your robot should be assembled in the same way as for the Getting Started lesson.
    • Your robot should be assembled in the same way as for the Getting Started lesson.

    • Make sure you plug the left motor into M1 and the right motor into M2!

  2. We're going to be writing a program to make our robot drive across the planet, rescue the astronaut, and bring them back.
    • We're going to be writing a program to make our robot drive across the planet, rescue the astronaut, and bring them back.

    • Let's start with the test program from the Getting Started section - you should have a program that makes the robot drive forwards forever.

    • Check your program looks like the picture.

  3. To rescue the stranded astronaut we need to know how to make the robot stop. First, drag in a Pause block, from the Basic menu.
    • To rescue the stranded astronaut we need to know how to make the robot stop.

    • First, drag in a Pause block, from the Basic menu.

    • This block makes the program pause for however long you tell it to!

    • The pause block takes a time in milliseconds - there are 1000 milliseconds in 1 second.

    • Change the number in the pause block to 2000 - this will make the robot pause for 2 seconds.

  4. Finally, we need to make the robot stop! Drag in another motor block  from the Invent menu, and change it so it makes the robot stop.
    • Finally, we need to make the robot stop!

    • Drag in another motor block from the Invent menu, and change it so it makes the robot stop.

    • Give your program a name - try and choose a name that reminds you what the program does.

    • Download the code, plug in the micro:bit and test it out on the robot - your robot should drive forwards for 2 seconds, and then stop.

    • Here's a hint - to make the motors stop, just set the speed to 0.

  5. It's easy to change your program by dragging the blocks around! Click and drag the first motor block to move everything underneath it away from the on start block.
    • It's easy to change your program by dragging the blocks around!

    • Click and drag the first motor block to move everything underneath it away from the on start block.

    • Notice how the blocks turn grey when you drag them away? This means they won't run when you program your robot.

    • You can also delete things you don't want anymore! Try dragging some blocks back into the menu area on the left to delete them.

  6. To save the astronaut, we need to attach the magnet module to the robot so we can pickup the magnetic astronaut. Remove the white trackball from the front of the robot - if you have a brand new kit it might be quite hard to get out, so ask your teacher for help if it is too difficult. Slot the magnet module over the top of the trackball, with the magnets facing upwards like in the picture.
    • To save the astronaut, we need to attach the magnet module to the robot so we can pickup the magnetic astronaut.

    • Remove the white trackball from the front of the robot - if you have a brand new kit it might be quite hard to get out, so ask your teacher for help if it is too difficult.

    • Slot the magnet module over the top of the trackball, with the magnets facing upwards like in the picture.

    • Finally put the trackball back into the robot like the picture. You should now be able to pickup an astronaut!

  7. Now you have mastered all of the things you need to save the stranded astronaut! Write a program to make your robot drive forwards across the planet on the activity mat, and pick up the astronaut. You will need to change the pause time so it drives forwards the right amount!
    • Now you have mastered all of the things you need to save the stranded astronaut!

    • Write a program to make your robot drive forwards across the planet on the activity mat, and pick up the astronaut. You will need to change the pause time so it drives forwards the right amount!

    • Don't forget to get your challenge checked off when you've completed the mission.

  8. For this extension challenge, add some blocks so your sequence makes the robot: Drive forward
    • For this extension challenge, add some blocks so your sequence makes the robot:

    • Drive forward

    • Stop and pickup the astronaut

    • Reverse back to the other side of the planet.

    • Don't forget to save your work!

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