Well i thougth i would try another approach and see if this is possible. I have tried to create a lookup table but I'm having problems with this. The code starts to work, when i press a button it goes to the table, it goes to the location and it then only displays the first character
Am i missing somthing or is this a dead end?
Code:DEFINE LCD_DREG PORTB 'Define PIC port used for LCD Data lines DEFINE LCD_DBIT 4 'Define first pin of portb connected to LCD DB4 DEFINE LCD_RSREG PORTB 'Define PIC port used for RS line of LCD DEFINE LCD_RSBIT 3 'Define Portb pin used for RS connection DEFINE LCD_EREG PORTB 'Define PIC prot used for E line of LCD DEFINE LCD_EBIT 0 'Define PortB pin used for E connection DEFINE LCD_BITS 4 'Define the 4 bit communication mode to LCD DEFINE LCD_LINES 2 'Define using a 2 line LCD DEFINE LCD_COMMANDUS 2000 'Define delay between sending LCD commands DEFINE LCD_DATAUS 50 'Define delay time between data sent. ' Control Buttons/Lines ' --------------------- ButStart var Portc.0 ' Take this pin low momentarily to START timing ButStop var Portc.1 ' Take this pin low momentarily to STOP timing ButReset var Portc.2 ' Take this pin low momentarily to RESET clock Butup var portc.3 ' Take this pin low momentarily to increase clock time Butdwn var portc.4 ' Take this pin low momentarily to decrease clock time b0 var word w0 var word Start: Lookup2 B0, ["hello", "help", "sory", "no"], W0 If ButStart=0 then b0=0 endif If butstop=0 then b0=b0-1 endif if butup=0 then b0=b0+1 endif GOSUB LCDDisplay Goto start LCDDisplay: LCDOUT w0 pause 60 return end




Bookmarks