' NEXUS Laser Wars VERSION 1.00 01/08/2003 '------------------------------------------------------------------------------------- 'ASCII art schematic ' - - - - - - - - - - - - - - -ve rail ' Pin | Pin | | ' 2 LED 4 PIEZO 10k ' ------ ______| | | ' |Picaxe| _______________| | ' | 08 | ____________________| ' ------ Pin 1 ADC | ' Infra-red ' Phototransistor ' | ' ||| | 3-5 V 'Usual 3 wire + + + + + + + + + + + + + + +ve supply 'prog.input '------------------------------------------------------------------------------------- main: 'make a label called "main" high 2 'switch on pin 2 and LED for EYES readadc 1,b0 'read channel 1 into variable b0 if b0 > 100 then I_got_shot 'if b0 > 150 then turn on off EYES goto main 'jump back to the start I_got_shot: 'make a label called "I_got_shot" low 2 'switch off pin 2 and EYES pause 3500 'pause for 3.5 seconds 'used to be a sound routine here for the buzzer! Decided to remove it! goto main 'jump back to start