Parallax BASIC Stamp 2e Programming Manual page 195

Table of Contents

Advertisement

Figure 5.16: Example LED Circuit.
2
1
2
e
NOTE: This is written for the BS2
but can be used for the BS1, BS2e,
BS2sx and BS2p also. Locate the
proper source code file or modify
the STAMP directive before
downloading to the BS1, BS2e,
BS2sx or BS2p.
5: BASIC Stamp Command Reference – NAP
2
2
Demo Program (NAP.bs2)
p
sx
' The program below lights an LED by placing a low on pin 0. This completes the circuit from
' +5V, through the LED and resistor, to ground. During the NAP interval, the LED stays lit, but
' blinks off for a fraction of a second. This blink is caused by the NAP wakeup mechanism
' During wakeup, all pins briefly slip into input mode, effectively disconnecting them from
' loads.
'{$STAMP BS2}
LOW 0
Snooze:
NAP 4
GOTO Snooze
P0
' Turn LED on.
' Nap for 288 ms.
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 193
Vdd
470
LED
'STAMP directive (specifies a BS2)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents