radiogareth
Senior Member
Its a simple project to illustrate outputting a binary word derived from a pot on the input ADC C.1. The ADC word is used to control 2 CMOS 4511 BCD to 7 segment drivers.
But it just counts up disregarding the value of B0!!
Even after ignoring it for the weekend I still can't see WHY it outputs each in sequence rather than skipping to the actual value in B0?
What am I missing here??
Thanks
But it just counts up disregarding the value of B0!!
Even after ignoring it for the weekend I still can't see WHY it outputs each in sequence rather than skipping to the actual value in B0?
What am I missing here??
Thanks
Code:
#picaxe 18m2
#no_data
dirsb=255
main:
readadc C.1, b0
'debug
if b0<5 then let outpinsb=%00000000 end if '0.0
pause 200
if b0<10 then let outpinsb=%00010000 end if '0.1
pause 200
if b0<15 then let outpinsb=%00100000 end if '0.2
pause 200
if b0<20 then let outpinsb=%00110000 end if '0.3
pause 200
if b0<25 then let outpinsb=%01000000 end if '0.4
pause 200
if b0<30 then let outpinsb=%01010000 end if '0.5
pause 200
if b0<30 then let outpinsb=%01100000 end if '0.6
pause 200
if b0<35 then let outpinsb=%01110000 end if '0.7
pause 200
if b0<40 then let outpinsb=%10000000 end if '0.8
goto main:
Last edited: