late_voyager
New Member
hi
I am trying to set a 24v low batt alarm.
i have volt dividers and adjusted to get reading ok
i have been trying to read w4 or b10 and b11 to add in code if w4 < 24xxx then alarm etc
cant seem to read w4 or b10,b11 and act on them however can display on screen
was trying:
if w4 < 23 then
goto lowbatt
or
if b10 <2 and b11<9 then
goto low batt
or
read w4, b27
if b27<24 then blah..
I am trying to set a 24v low batt alarm.
i have volt dividers and adjusted to get reading ok
i have been trying to read w4 or b10 and b11 to add in code if w4 < 24xxx then alarm etc
cant seem to read w4 or b10,b11 and act on them however can display on screen
was trying:
if w4 < 23 then
goto lowbatt
or
if b10 <2 and b11<9 then
goto low batt
or
read w4, b27
if b27<24 then blah..
Code:
Symbol bbatt = w4
Symbol batt = w8
symbol bbattv = 250
symbol battv = 38
readadc10 C.2, bbatt ' 24v batt
bbatt = bbatt *bbattv
bintoascii bbatt,b10,b11,b12,b13,b14
readadc10 B.0, batt ' 3v batt
batt = batt *battv
bintoascii batt,b18,b19,b20,b21,b22
serout C.0,N2400,(254,128)
serout C.0,N2400,("Batt ",b10,b11,"v - ",b18,".",b19,"v ")