Specifications
BASIC Stamp II
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 335
2
restores the I/O directions dictated by your program.
If you plan to use End, Nap, or Sleep in your programs, make sure that
your loads can tolerate these periodic power outages. The simplest
solution is often to connect resistors high or low (to +5V or ground) as
appropriate to ensure a continuing supply of current during the reset
glitch.
Demo Program
This program demonstrates both Sleep’s tim-
ing characteristics and the periodic glitch dis-
cussed above. Connect an LED to pin 0 as
shown in figure I-27 and run the program.
The LED will blink, then the BS2 will go to
Sleep. During Sleep, the LED will remain on,
but will wink out at intervals of approxi-
mately 2.3 seconds.
low 0 ' Turn LED on.
pause 1000 ' Wait 1 second.
again:
high 0 ' LED off.
pause 1000 ' Wait 1 second.
low 0 ' LED back on.
SLEEP 10 ' Sleep for 10 seconds.
goto again
220Ω
LED
I/O pin
+5V
Figure I-27










