I speak a little english
I made a lcd menu, very good with trhee buttons
MENU,ENTER and BACK
So, now I need A Scroll LCD messague I imagine is with FOR.. NEXT.
This is the code example, it's free. WORK OK 100%
' Definiciones
DEFINE OSC 4 'oscilador de 4 Mhz
' Constante de Tiempos (time)
SYMBOL T1 = 200
' modo LCD de 8 bits
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
' Define program variables
SYMBOL SW1 = PORTC.0 ' Switch 1 "MENU"
SYMBOL SW2 = PORTC.1 ' Switch 2 "DEFILE"
SYMBOL SW3 = PORTC.2 ' Switch 3 "ENTER"
' Variables diversas
MENU VAR BYTE ' Position dans les MENUS
POSI VAR BYTE ' Position sur le LCD
'*** INITIALISATION ************************************************** *****************************
' Initialisation of ports
ADCON1 = 7 ' Set PORTA to digital
low PORTB.1
' Initialisation
PAUSE 300 ' Wait for LCD to initialise
LCDOUT $FE,1 ' Clear LCD
' Inicializacion de variables
MENU = 0
LCDOUT $FE,128," Soft Elio "
'
'************************************************* *************************************************
' cuerpo del programa
'************************************************* *************************************************
MAIN:
IF SW1 = 0 THEN
MENU = 1
GOSUB CONFIGURE
ENDIF
GOTO MAIN
END
'************************************************* *************************************************
' MENU CONFIGURATION
'************************************************* *************************************************
CONFIGURE:
PAUSE T1
'--- Switch MENU-----------------------------------------------------------------------
IF SW1 = 0 THEN
MENU = MENU + 1
GOSUB AFFICHEMENU
SUITECONFIGURE:
SELECT CASE MENU
CASE 6
PAUSE T1
IF SW1 = 0 THEN
MENU = 1
GOTO CONFIGURE
ENDIF
IF SW3 <> 0 THEN SUITECONFIGURE
END SELECT
ENDIF
'--- Switch "ENTER" -----------------------------------------------------------
SWITCH3:
IF SW2 = 0 THEN
LCDOUT $FE,1 ' Clear LCD
SELECT CASE MENU
CASE 2 :GOSUB PROG1:MENU=2
CASE 3 :GOSUB PROG2:MENU=2
'CASE 4 others aplications
'CASE 5
END SELECT
GOSUB AFFICHEMENU
ENDIF
GOTO CONFIGURE
AFFICHEMENU:
LCDOUT $FE,1
SELECT CASE MENU
CASE 2
POSI = 129 : GOSUB MSG6 : GOSUB MSG1
POSI = 193 : GOSUB MSG2
CASE 3
POSI = 129 : GOSUB MSG6 : GOSUB MSG2
POSI = 193 : GOSUB
CASE 4
POSI = 129 : GOSUB MSG6 : GOSUB MSG3
POSI = 193 : GOSUB MSG4
CASE 5
POSI = 129 : GOSUB MSG6 : GOSUB MSG4
POSI = 193 : GOSUB MSG5
CASE 6
POSI = 129 : GOSUB MSG6 : GOSUB MSG5
POSI = 193 : GOSUB MSG1 '
END SELECT
RETURN
PROG1:
lcdout $fe,1, " LED "
lcdout $fe,1, " FLASHER "
pause T1
high porta.0
pause t2
low porta.0
goto PROG1
IF SW3=0 THEN RETURN
GOTO PROG1
PROG2:
INCLUDE "scroll.bas"
IF SW3=0 THEN RETURN
GOTO PROG2
'************************************************* *************************************************
' Lista de mensajes
'************************************************* *************************************************
MSG1: LCDOUT $FE,POSI,"1.Motor DC" : RETURN
MSG2: LCDOUT $FE,POSI,"2.Motor AC" : RETURN
MSG3: LCDOUT $FE,POSI,"3.Lampara" : RETURN
MSG4: LCDOUT $FE,POSI,"4.Temperatura" : RETURN
MSG5: LCDOUT $FE,POSI,"5.Opcional " : RETURN
MSG6: LCDOUT $FE,128,">" : RETURN




Bookmarks