Hello
I am a bit banger from the sixties. Is there a better way to do the following
using Picaxe-20M? I am reading BCD thumbwheel switches(1-2-4-8 on units and 1-2 on tens) with the common grounded.
Thanks
Al
I am a bit banger from the sixties. Is there a better way to do the following
using Picaxe-20M? I am reading BCD thumbwheel switches(1-2-4-8 on units and 1-2 on tens) with the common grounded.
Code:
result = 0
result10 = 0
let b0 = pins & $3f
if bit0 = 0 then:result = result +1
endif
if bit1 = 0 then:result = result +2
endif
if bit2 = 0 then:result = result + 4
endif
if bit3 = 0 then:result = result + 8
endif
if bit4 = 0 then:result10 = 1
endif
if bit5 = 0 then:result10 = result10 +2
endif '
result10 = result10 * 10 '
cnt1 = result10 + result
Al
Last edited: