Hola que tal
Antes que nada, buenas tardes a todos los del foro. Estoy realizando un proyecto y me he detenido por algunas cosas las cuales no entiendo o no puedo. Estoy
utilizando una LCD. Mi problema es el siguiente: son una lista de nombres de herramientas y quiero con un botón desplegarloz en la LCD y así poder seleccionar alguno de ellos
y en caso de haberme pasado con otro botón regresar al nombre anterior. Y ya al haberlo escogido, seleccionarlo.
Aquí les muestro el código. En caso de tener otro error, les agradecería que me lo dijeran.
Saludos
program Ohmetro ' NOMBRE DEL PROGRAMA
dim keypadPORT as byte at PORTD
dim LCD_RS as sbit at RB4_bit ' conexion del modulo LCD
LCD_EN as sbit at RB5_bit ' BIT PORTB,5 A LCD
LCD_D4 as sbit at RB0_bit ' BIT PORTB,0 A LCD
LCD_D5 as sbit at RB1_bit ' BIT PORTB,1 A LCD
LCD_D6 as sbit at RB2_bit ' BIT PORTB,5 A LCD
LCD_D7 as sbit at RB3_bit ' BIT PORTB,3 A LCD
LCD_RS_Direction as sbit at TRISB4_bit ' DIRECCION DE TRISB4 PARA LCD
LCD_EN_Direction as sbit at TRISB5_bit ' DIRECCION DE TRISB5 PARA LCD
LCD_D4_Direction as sbit at TRISB0_bit ' DIRECCION DE TRISB0 PARA LCD
LCD_D5_Direction as sbit at TRISB1_bit ' DIRECCION DE TRISB1 PARA LCD
LCD_D6_Direction as sbit at TRISB2_bit ' DIRECCION DE TRISB2 PARA LCD
LCD_D7_Direction as sbit at TRISB3_bit ' DIRECCION DE TRISB3 PARA LCD
dim text as string [16] ' variable de texto
dim tlong as longword ' variaple tipo longword
dim ohm,abc,mh,ppm,ch,decimal,adc_rd,cen,decenas,uni as word ' variable son de tipo word
dim boton as byte
main: ' INICIO DEL PROGRAMA
TRISB = 0 ' ES SALIDA
PORTB = 0xFF ' 11111111 A PORTB
INTCON = 0 ' ESTADO 0
ANSEL = 0x04 ' EL PIN RA2 SE COMFIGURA COMO ENTADA ANALOGICA
TRISA = 0x04 ' PORTA,2 SE CONFIGURA COMO ENTRADA ANALOGICA
ANSELH = 0 ' LOS DEMAS PINES SE CONFIGURAN COMO SALIDAS DIGITALES
Lcd_Init() ' INICIALIZACION DE LA LCD
Lcd_Cmd(_LCD_CURSOR_OFF) ' COMANDO LCD (apagar el cursor)
Lcd_Cmd(_LCD_CLEAR) ' COMANDO LCD (borrar lcd)
text = "PEMEX - SERVICIO" ' DEFINIR EL MENSAJE PEMEX- SERVICIO
Lcd_Out(1,1,text) ' ESCRIBIMOS EL MENSAJE LINEA
text = " A POZOS" ' DEFINIR EL MENSAJE A POZOS
Lcd_Out(2,2,text) ' ESCRIBIMOS EL MENSAje LINEA
Delay_ms(700) ' RETARDO 500ms
Lcd_Cmd(_LCD_CURSOR_OFF) ' COMANDO LCD (apagar el cursor)
Lcd_Cmd(_LCD_CLEAR) ' COMANDO LCD (borrar lcd)
text = "SELECCIONE" ' DEFINIR EL MENSAJE
Lcd_Out(1,1,text) ' ESCRIBIMOS EL MENSAJE LINEA
text = "HERRAMIENTA: " ' DEFINIR EL MENSAJE UTILIZAR
Lcd_Out(2,2,text) ' ESCRIBIMOS EL MENSAje LINEA
while 1 ' ESPERAR A QUE BOTON SE PRESIONE
if boton = 0 then
while boton = 1
boton = "PBM-S"
Lcd_Chr_CP(boton) ' VISUALIZAR EN EL LCD
wend
end.