' ========================================================================= ' File....... SW21-EX04-Runway_LEDs.SXB ' Purpose.... Advanced LED Flasher ' Author..... (C) 2000 - 2005, Parallax, Inc. ' E-mail..... support@parallax.com ' Started.... 01 SEP 2005 ' Updated.... 23 MAR 2007 by TSaavik for SX28 ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' ' Strobe one of eight LEDs to behave like airport runway landing lights. ' This program will work, unmodified, on any BS2-family module. '------{ Device Settings ]------------------------------------------------- DEVICE SX28,TURBO,BANKS8,OSCHS3,SYNC,OPTIONX FREQ 50_000_000 ID "EX03" ' -----[ I/O Definitions ]------------------------------------------------- LEDs VAR RB ' LEDs on RB.0 - RB.7 ' -----[ Constants ]------------------------------------------------------- 'DelayTm CON 100 ' delay time for LEDs DelayTm CON 1 ' delay time for LEDs in SXSIM ' -----[ Initialization ]------------------------------------------------- PROGRAM Start ' -----[ Program Code ]---------------------------------------------------- Start: LEDS = %00000001 ' start with right LED on Tris_B = %00000000 ' make LEDs outputs Main: LEDs = %00000001 ' start with right LED on DO PAUSE DelayTm ' on-time for lit LED LEDs = LEDs << 1 ' shift LED left LOOP UNTIL LEDs = %10000000 ' test for last LED GOTO Main