' ========================================================================= ' ' File....... SW21-EX02-Flash_LED-Adv.BS2 ' Purpose.... Advanced LED Flasher ' Author..... (C) 2000 - 2005, Parallax, Inc. ' E-mail..... support@parallax.com ' Started.... ' Updated.... 01 SEP 2005 ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' ' Flashes an LED connected to P0. This program will work, unmodified, on ' any BS2-family module. ' -----[ I/O Definitions ]------------------------------------------------- Strobe PIN 0 ' LED on P0 ' -----[ Constants ]------------------------------------------------------- IsOn CON 1 ' on for active-high LED IsOff CON 0 ' off for active-high LED FlashOn CON 50 ' on for 50 ms FlashOff CON 950 ' off for 950 ms ' -----[ Initialization ]-------------------------------------------------- Reset: Strobe = IsOff OUTPUT Strobe ' enable pin to drive LED ' -----[ Program Code ]---------------------------------------------------- Main: DO Strobe = IsOn PAUSE FlashOn Strobe = IsOff PAUSE FlashOff LOOP