;Program PPM (PICAXE PANEL Meter) N2CX 042407 ;Rev 1.0 (original) ;Uses ADC input and drives CD4017 Johnson decade counter ;For 10 segment analog of panel meter ; Symbol Inpin = 1 Symbol clockpin = 2 Symbol resetpin = 4 Symbol Vin = b0 Symbol reading = b1 Symbol index = b2 Start: high resetpin ;reset counter pause 1 low resetpin ;clear counter reset readadc inpin, vin ;read input voltage reading = Vin/26 ;scale to 0-9 range if reading =0 then Skip for index = 1 to reading ;output meter pulses to counter high clockpin ; pause 1 low clockpin ; pause 1 next Skip: pause 100 ; allow time to read meter Goto Start