EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 195

Default Icon
353 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
5: BASIC Stamp Command Reference NAP
BASIC Stamp Programming Manual 2.0c www.parallaxinc.com Page 193
Demo Program (NAP.bs2)
' 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} 'STAMP directive (specifies a BS2)
LOW 0 ' Turn LED on.
Snooze:
NAP 4 ' Nap for 288 ms.
GOTO Snooze
1
2
e
2
sx
2
p
2
P0
Vdd
470
LED
Figure 5.16: Example LED Circuit.
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.

Table of Contents

Related product manuals