BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – PULSOUT
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 349
Setup:
HIGH 0 ' make P0 high (LED off)
Main:
PULSOUT 0, 2500 ' flash LED for 25 mS
PAUSE 1000 ' one second delay
GOTO Main
END
Demo Program (PULSOUT.bs2)
' PULSOUT.bs2
' This program blinks an LED on for 25 ms at 1-second intervals. Connect an
' LED (active-low) to I/O pin 0.
' {$STAMP BS2}
' {$PBASIC 2.5}
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
Scale CON 500 ' to ms for 2 us per unit
#CASE BS2SX, BS2P, BS2PX
Scale CON 1250 ' to ms for 0.8 us per unit
#ENDSELECT
Flash CON 25 * Scale ' 25 milliseconds
Setup:
HIGH 0 ' make P0 high (LED off)
Main:
PULSOUT 0, Flash ' flash LED
PAUSE 1000 ' one second delay
GOTO Main
END
NOTE: This example program can be
used with all BS2 models. This program
uses conditional compilation techniques;
see Cha
p
ter 3 for more information.
All
2