This program:-
Tells me that:
b3 = b1 * 100/b2
b3 = 252 * 100/40
b3 = 25200/40
b3 = 118
On my planet, the answer is 630.
I have no clue why this is coming out with such weirdness, can anyone tell me what on earth is going on?
Thanks
Code:
init: pause 500
main: serout B.1,N2400,(254,1)
pause 30
low B.0 low B.2
pause 200
serout B.1,N2400,(254,192)
serout B.1,N2400,("init")
pause 300
readadc B.4,b1
pause 30
serout B.1,N2400,(254,128)
serout B.1,N2400, ("init is")
serout B.1,N2400, (#b1)
pause 2500
high B.2
pause 2500
low B.2
serout B.1,N2400,(254,192)
serout B.1,N2400,("after")
pause 940
readadc B.4,b2
pause 100
serout B.1,N2400,(254,192)
serout B.1,N2400, ("after ")
serout B.1,N2400, (#b2)
b3 = b1 * 100 / b2
serout B.1,N2400, (" ")
serout B.1,N2400, (#b3)
pause 2500
if b3 > 155 then
serout B.1,N2400, (" OK")
high B.0 low B.2
else
serout B.1,N2400, (" RPT")
low B.0 high B.2
end if
pause 700
'goto main
end
b3 = b1 * 100/b2
b3 = 252 * 100/40
b3 = 25200/40
b3 = 118
On my planet, the answer is 630.
I have no clue why this is coming out with such weirdness, can anyone tell me what on earth is going on?
Thanks
Last edited by a moderator: