Hello,
I wrote a small program :
I think its self explanatory. Push a button, then do Sub_MicroControllerBatteryCheck function, otherwise just print constant.
The problem is this. The lCD keep jumping from function to function without me pressing anything
Someone have an idea why ?
Ken
portB = 0
loop:
if portB.5 = 1 then
goto Sub_MicroControllerBatteryCheck
else
goto print
endif
print:
Lcdout $fe, 1 'Clear screen
Lcdout "Left: ", Dec 534
Lcdout $fe, $C0, "Right: ", Dec 999
portB.7 = 1
pause 150
portB.7 = 0
goto loop
Sub_MicroControllerBatteryCheck:
adcin 6,battery1
battery1 = 100-( 10*(1024-battery1) )/20
Lcdout $fe, 1 'Clear screen
Lcdout "Battery1: ", Dec battery1
portB.6 = 1
Pause 150
portB.6 = 0
goto loop
End
Bookmarks