BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – NAP
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 287
Figure 5.18: Example LED Circuit.
Demo Program (NAP.bs2)
' 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 sec.
' 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}
Setup:
LOW 0 ' turn LED on
Snooze:
NAP 4 ' nap for 288 ms
GOTO Snooze
END
1
A
ll
2
NOTE: This example program can be
used with the BS1 and all BS2 models
by changing the $STAMP directive
accordingly.