Parallax Boe-Bot Student Manual page 65

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

How HighLowLed.bs2 Works
Figure 2-6 shows how the BASIC Stamp can connect an LED circuit alternately to Vdd
and Vss. When it's connected to Vdd, the LED emits light. When it's connected to Vss,
the LED does not emit light. The command
connect P13 to Vdd. The command
circuit in that state for 500 ms. The command
connect the LED to Vss. Again, the command
leave it in that state for another 500 ms. Since these commands are placed between
and
, they execute over and over again.
LOOP
SOUT
VIN
1
24
SIN
VSS
2
23
BS2
ATN
RES
3
22
VSS
VDD (+5V)
4
21
P15
P0
5
20
Vdd
P1
P14
6
19
P2
P13
7
18
Vss
P3
P12
8
17
P4
P11
9
16
P5
P10
10
15
P6
P9
11
14
P7
P8
12
13
BS2-IC
A Diagnostic Test for your Computer
A very few computers, such as some laptops, will halt the PBASIC program after the first
time through a
...
DO
LOOP
By placing a
command the program LedOnOff.bs2, the open Debug Terminal
DEBUG
prevents this from possibly happening. You will next re-run this program without the
command to see if your computer has this non-standard serial port problem. It is
DEBUG
not likely, but it would be important for you to know.
Open HighLowLed.bs2.
Delete the entire
Run the modified program while you observe your LED.
If the LED blinks on and off continuously, just as it did when you ran the original
program with the
DEBUG
If the LED blinked on and off only once and then stopped, you have a computer with a
non-standard serial port design. If you disconnect the serial cable from your board and
Chapter 2: Your Boe-Bot's Servo Motors · Page 51
HIGH 13
PAUSE 500
PAUSE 500
SOUT
1
SIN
2
BS2
ATN
3
VSS
4
P0
5
Vdd
P1
6
P2
7
Vss
P3
8
P4
9
P5
10
P6
11
P7
12
BS2-IC
loop. These computers have a non-standard serial port design.
instruction.
DEBUG
command, your computer will not have this problem.
instructs the BASIC Stamp to
instructs the BASIC Stamp to leave the
instructs the BASIC Stamp to
LOW 13
instructs the BASIC Stamp to
VIN
24
Figure 2-6
VSS
23
BASIC Stamp
RES
22
VDD (+5V)
Switching
21
P15
20
P14
19
P13
18
P12
The BASIC Stamp
17
P11
16
can be programmed
P10
15
to internally connect
P9
14
the LED circuit's
P8
13
input to Vdd or Vss.
DO

Advertisement

Table of Contents
loading

Table of Contents