' ========================================================================= ' ' File...... GoE.Simple Light Flasher Using the RC-4.bs1 ' Purpose... Simple Light Flasher Using the RC-4 ' Author.... Geoff @ The GARAGE OF EVIL!! ' E-mail.... geoff@garageofevil.com ' Web....... http://www.garageofevil.com ' ' {$STAMP BS1} ' {$PBASIC 1.0} ' ' ========================================================================= ' Input PINs SYMBOL Trigger1 = PIN0 ' PIN 0 is our trigger ' Output PINs SYMBOL RC4sio = 6 ' PIN 6 is our connection to the RC-4 ' RC4 Settings ' set the baud rate at 2400 for the Prop-1 to RC-4 serial connection SYMBOL RC4Baud = OT2400 ' we're using address #11 (both A0 and A1 jumpers are on both pins) SYMBOL RC4Addr = %11 ' reserve a point in memory for our counter used in the Flash_Lights Subroutine SYMBOL Counter = B1 Reset: SEROUT RC4sio, OT2400, ("!RC4", RC4Addr, "X") ' reset all relays to OFF Main: ' if the trigger was pressed, then run the Flash_Lights subroutine below IF Trigger1 = 1 THEN Flash_Lights GOTO Main Flash_Lights: ' COUNT FROM 1 to 20, and run this code 20 times. FOR Counter = 1 TO 20 ' CLOSE THE RELAY CIRCUIT / TURN IT ON SEROUT RC4sio, RC4Baud, ("!RC4", RC4Addr, "R", 1, 1) ' WAIT A SPLIT SECOND PAUSE 25 ' OPEN THE RELAY CIRCUIT / TURN IT OFF SEROUT RC4sio, RC4Baud, ("!RC4", RC4Addr, "R", 1, 0) ' LOOP BACK UNTIL THE COUNTER REACHES 20 NEXT GOTO Main