' NEXUS Bike Indicator VERSION 1.00 01/08/2003 '------------------------------------------------------------------------------------- 'ASCII art schematic ' - - - - - - - - - - - - - - - - - -ve rail ' Piezo Pin | Pin | | | ' (to pin 2) 0 LED 4 LED 10k 10k ' ------ ______| | | | ' |Picaxe| _______________| | | ' | 08 | ____________________| | ' ------ Pin 1 | | ' Switch1 Switch2 ' ____________________^______| ' Pin 3 | | ' ||| | | 3-5 V 'Usual 3 wire + + + + + + + + + + + + + + + + + +ve supply 'prog.input '------------------------------------------------------------------------------------- main: 'make a label called "main" if pin1 = 1 then Indicate_left 'switch1 is pressed so goto IndicateLeft if pin3 = 1 then Indicate_right 'switch2 is pressed so goto IndicateRight goto main 'jump back to the start Indicate_left: 'make a label called "Indicate_left" high 0 'switch on pin 0 LED and piezo high 2 pause 350 'wait 0.35 seconds low 0 'switch off pin 0 LED and piezo low 2 pause 350 goto main 'jump back to start Indicate_right: 'make a label called "Indicate_right" high 4 'switch on pin 4 LED and piezo high 2 pause 350 'wait 0.35 seconds low 4 'switch off pin 4 LED and piezo low 2 pause 350 goto main 'jump back to start