Chapter 2: Your Boe-Bot’s Servo Motors
· Page 53
Your Turn – Blink the Other LED
Blinking the other LED (connected to P12) is a simple matter of changing the
Pin
argument in the
HIGH
and
LOW
commands and re-running the program.
√
Modify the program so that the commands look like this:
DO
HIGH 12
PAUSE 500
LOW 12
PAUSE 500
LOOP
√
Run the modified program and verify that it makes the other LED blink on/off.
You can also make both LEDs blink at the same time.
√
Modify the program so that the commands look like this:
DO
HIGH 12
HIGH 13
PAUSE 500
LOW 12
LOW 13
PAUSE 500
LOOP
√
Run the modified program and verify that it makes both LEDs blink on and off
at roughly the same time.
You can modify the program again to make one LEDs blink alternately on/off, and you
can also change the rates that the LEDs blink by adjusting the
PAUSE
command’s
Duration
argument higher or lower.
√
Try it!
Viewing a Servo Control Signal with an LED
The high and low signals you will program the BASIC Stamp to send to the servo motors
must last for very precise amounts of time. That’s because the servo motors measure the
amount of time the signal stays high, and use it as an instruction for where to turn. For