
Originally Posted by
lerameur
Ok basically I am looking for :
The LCD module will show the discharging/charging percentage of the battery.
The time of each discharge and charge cycle are accumulated in an array.
when the user hit a button, it will put him into a menu. On another button the user can go through the array and view the charge dicharge time one by one. When no selection is done for 15 seconds, The program returns to the previous state.
K
I use something similar in one of my projects - uses a 4 x 20 LCD
Code:
mainmenu:
LCDOUT $FE,2,"Main Menu"
lcdout $FE, $C0, "Select Option"
IF Option = 1 THEN lcdout $FE, $D4, "option 1 "
if option = 2 then lcdout $FE, $D4, "option 2 "
if option = 3 then lcdout $FE, $D4, "option 3 "
if option = 4 then lcdout $FE, $D4, "option 4 "
if option = 5 then lcdout $FE, $D4, "option 5 "
if option = 6 then lcdout $FE, $D4, "option 6 "
IF !H_butt THEN Option = option + 1
pause 200
if option >6 then option = 1
If option = 1 Then
If S_butt = 0 Then
LCDOUT $FE,1
Gosub SetButtonRelease
goto option_one
endif
endif
If option = 2 Then
If S_butt = 0 Then
LCDOUT $FE,1
Gosub SetButtonRelease
goto option_two
endif
endif
.... etc etc for all remaining options
To do the time out you could use something like
Code:
Pause 1 ' Kill 1mS
TimeOut=TimeOut+1
If TimeOut>20000 then goto mainprogram
Obviously you need to either set or use your own variables
Hope that helps
Bookmarks