10/23/09 A new Design I have been working on for a few days
|
Code below
'********************************************************************
'* *
'* 14m chip - 2 adc inputs b0, b1 compared, 11 15 09 works fine *
'* *
'********************************************************************
'
startup:
wait 5
'symbol RED_LED = 7 ‘ define a output pin
'symbol PUSH_SW = pin1 ‘ define a input switch
'symbol DELAY = wait 3 ‘ define a variable symbol
DELAY:
wait 5
low 0,1,2,3,4,5
main:
readadc 4,b0 : readadc 0,b1
debug b0 : debug b1
if b0 > b1 then table
'if b0 < b1 then p7
table:
if b0 > 132 then p1
if b0 > 130 then p2
if b0 > 128 then p3
if b0 > 126 then p4
if b0 > 124 then p5
if b0 > 122 then p6
if b0 < 121 then p7
p7:goto DELAY
p6:high 0 goto DELAY
p5:high 0,1 goto DELAY
p4:high 0,1,2 goto DELAY
p3:high 0,1,2,3 goto DELAY
p2:high 0,1,2,3,4 goto DELAY
p1:high 0,1,2,3,4,5 goto DELAY