|Drive to tunnel.|
Set Output 1 High. Headlights on.
Drives through tunnel with lights on.
Set Output 1 Low. Headlights off.
Drives away from tunnel.
The Roamer car drives to the tunnel, turns its headlights on, drives through the tunnel, turns the lights off and drives away.
Flashing Lights: There are two ways to make a light flash.
|1. Connect a light at Output 4.||This causes the light to flash on and off ten times at one second intervals. (The Roamer will not move, turn or do anything else while the light is flashing).|
|2. Connect a Flasher Unit (provided in the
Valiant Light Pack) to Output 4.||By setting the Output High the light connected to the unit will flash automatically, allowing the Roamer to continue with other activities. The program will make the light flash while the Roamer turns through 90 degrees.|
Direction of Turn: In all Valiant documentation, the following convention has been adopted for describing a motor's direction of turn.
Driving a DC Motor When a DC motor is connected to an Output and the Output is set High, the motor will turn but in only one direction. To reverse the direction of the motor it is necessary to swap the wires to the Output and Ground terminals.
Programming the Direction of a DC Motor The motor may be programmed to turn in either direction by connecting it to two Output terminals, rather than to an Output and a Ground.
Make a Roamer submarine. Connect the motor to Output 1 and Output 2. Program the submarine propeller to 'drive' the submarine forward and backwards.
|Set Output 1 High (Output 2 will be Low) and the motor will turn clockwise.|
|The Roamer moves forward with the motor turning the propeller clockwise.|
|Set Output 1 Low. (Output 2 Low). The motor stops.|
|The submarine stays still for 5 seconds. The propeller does not turn.|
|Set Output 2 High. (Output 1 Low) and the motor will turn anticlockwise.|
|The Roamer will move backwards with the motor turning the propeller anticlockwise.|
|Help! The Outputs Don't Work|
If you connect a light at Output 1 and, for example, enter it may appear that the light does not turn on. (The same thing would happen if the instruction was entered at the end of a GO program)
sets Output 1 High. Since there are no further instructions in the GO program, it immediately returns to its original state, with Output 1 Low. The light turns on and off so quickly you don't see it.
|NEXT ISSUE: Using a stepper motor.|