Hi All,
Please help me with this program , the LCD works well but the problem is when i press the button PortE is not inverted.
here is my code
Please help me with this program , the LCD works well but the problem is when i press the button PortE is not inverted.
here is my code
Code:
program third
' Declarations section
dim GLCD_DataPort as byte at PORTD
dim GLCD_CS1 as sbit at RB0_bit
GLCD_CS2 as sbit at RB1_bit
GLCD_RS as sbit at RB2_bit
GLCD_RW as sbit at RB3_bit
GLCD_EN as sbit at RB4_bit
GLCD_RST as sbit at RB5_bit
dim GLCD_CS1_Direction as sbit at TRISB0_bit
GLCD_CS2_Direction as sbit at TRISB1_bit
GLCD_RS_Direction as sbit at TRISB2_bit
GLCD_RW_Direction as sbit at TRISB3_bit
GLCD_EN_Direction as sbit at TRISB4_bit
GLCD_RST_Direction as sbit at TRISB5_bit
' End Glcd module connections
dim counter as byte
someText as char[18]
dim i as word
ADCON1 = 7 ' All pins digital
CMCON = 7 ' All comparator Off
TRISC=%11111111
TRISE=%000000
PORTE=000000
main:
Glcd_Init()
Glcd_Fill(0x00) ' Clear Glcd
Glcd_Set_Font(@Font_Glcd_Character8x7, 8, 7, 32) ' Choose font "Character8x7"
Glcd_Write_Text("Hello World", 0, 0, 2)
if Button(PORTC, 2, 0, 1) then portE=NOT (PORTE)
end if
end.
[Code]