For this program you will need to connect one motor to port A on the RCX and one motor to port C on the RCX.

Our first program will be very simple. 

It will

  • turn on motors A for C in a forward direction for 4 seconds
  • stop them
  • then turn them back on in the opposite direction for 4 seconds
  • then stop

 

Clicking on the   icon below will start a video that will show you how to do the activity.  You will need the Flash player installed to use it.
Start Robolab using Inventor Level 3. 

Drag the motor forward icons onto your program area.

    Open the 'Wait for' panel

 

  Drag the 4s icon onto your program.

Drag more icons onto your program until it looks like this. Note that you need the final stop icon, because the end program stop light does not turn off your motors.

You will notice that some icons are connected by pink wires, but some are not.  To string together the missing ones, choose the string tool , click on the top right corner of one icon and then the top left of the next.

The string tool can be found on the tools palette.  If you can't see the Tools palette, from the menu choose Window  > Show Tools Palette

When all your icons are correctly strung together the run arrow in the top toolbar will light up.

If you click on it before it has lit up, the program will tell you where there are errors. 

You can now download your program to the RCX and test it.

Adding modifiers

We will now add some power modifiers to the motors.  If you don't add modifiers, the motors run at full power (5).

Open the modifiers palette by right clicking the modifiers icon , then clicking the push pin.

Drag the power level 3 icon to each of the first two motors

If they don't automatically connect, you use the string tool , click in the lower right corner of the motor icon and then click on the top corner of the modifier.

  Now add modifiers to make the motors reverse at power level 3.
   
Instead of using the motor A icon , you can use the unlabelled motor icon with a modifier to show which motor you are referring to.  This makes adjusting your programs at a later stage easier.
 These modifiers indicate motors A & B forward at power level 5.

 

 

What will happen if you make each of the motors run in opposite directions?

Write and test a program that will make the bot move forward at full power for 2 seconds, then turn to the right and move forward at half power for 4 seconds.