' ========================================================================= ' ' File....... ELights.BS2 ' Purpose.... Emergency Light Display Control ' Author..... Jon Williams -- Parallax, Inc. ' E-mail..... jwilliams@parallax.com ' Started.... ' Updated.... 07 FEB 2005 ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- LEDs VAR OUTL ' LEDs on P0 - P7 ' -----[ Constants ]------------------------------------------------------- ' -----[ Variables ]------------------------------------------------------- idx1 VAR Nib idx2 VAR Nib ' -----[ EEPROM Data ]----------------------------------------------------- Pattern1 DATA %00011000 DATA %00100100 DATA %01000010 DATA %10000001 ' -----[ Initialization ]-------------------------------------------------- Reset: DIRL = %11111111 ' LED lines are outputs ' -----[ Program Code ]---------------------------------------------------- Main: FOR idx1 = 1 TO 10 ' run pattern 10 times FOR idx2 = 0 TO 3 ' four elements in pattern READ Pattern1 + idx2, LEDs ' display element PAUSE 75 ' short delay NEXT NEXT Flash: LEDs = %00000000 ' all off FOR idx1 = 1 TO 10 LEDs = ~LEDs ' invert LEDs PAUSE 50 NEXT GOTO Main ' do forever END ' -----[ Subroutines ]-----------------------------------------------------