RMParkhouse
New Member
Hey i am creating a keypad for a project and i want to use only one picaxe input for 10 buttons (0-9), i was thinking that i could just connect them all to a different value resistor and then use the input as a variable, eg:
main:
readadc 2, b0
if b0<10 then valZERO
if b0>10 and b0<20 then valONE
...etc etc...
valZERO:
let b1=0
goto main
etc etc..
all that would really do is insert s different value into b1 depending on which button is pressed, would this work nd also is there a betterway to do it using only one input?
Â
main:
readadc 2, b0
if b0<10 then valZERO
if b0>10 and b0<20 then valONE
...etc etc...
valZERO:
let b1=0
goto main
etc etc..
all that would really do is insert s different value into b1 depending on which button is pressed, would this work nd also is there a betterway to do it using only one input?
Â