'PICAXE-08 serial INPUT data control link for July 2003 SiChip article V 1.0 15/5/03 'Needs matching output program & hardware at sender PICAXE for receiver piezo control 'Connect piezo to PICAXE-08 pin 0 - ref article for use as programming feedback too. '2 wires between units only - data on pin 4 linking both & simple ground return 'Inputs such high impedance that even damp string (~ 1MOhm) may be used as conductor! 'Variable b0= sender switch status (0=off/low,1=on/high) with 10k pulldown resistor 'NB -serial link decoding overheads may mean time delays (?)-easily *pause* tweaked. 'Via Stan. SWAN (MU@W,New Zealand) => s.t.swan@massey.ac.nz <= '------------------------------------------------------------------------------------ ' Lines beginning ' are program documentation & may be ignored if need be. ' Program available for web download =>www.picaxe.orcon.net.nz/rx.bas '------------------------------------------------------------------------------------ state: ' procedure to serial data read sender switch state serin 4,n2400,b0 ' set up serial input on pin 4 & wait for b0 value if b0 =1 then fastbeep ' check b0 & jump to fastbeep if =1(ON) else continue slowbeep: ' slow beep routine when switch is low (OFF) sound 0,(80,20) ' 20 ms lazy beep to piezo attached direct to pin 0 pause 1000 ' 1 sec delay (may need altering to synch. ?) goto state ' return to serial link switch reading input fastbeep: ' fast beep routine when switch is high (ON) sound 0,(100,10) ' 10 ms higher pitched urgent beep to pin 0 piezo pause 250 ' 1/4 sec delay ( may also need altering ?) goto state ' return to serial link switch reading input