krtodoroff
Newbie level 5
Have problem, Buttons on PORTA not working .LCD work OK bu buttons not answar. Please help.
Thak You
Here CODE:
Thak You
Here CODE:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 sbit LCD_RS at RB4_bit; sbit LCD_EN at RB2_bit; sbit LCD_D4 at RD7_bit; sbit LCD_D5 at RD6_bit; sbit LCD_D6 at RD5_bit; sbit LCD_D7 at RD4_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB2_bit; sbit LCD_D4_Direction at TRISD7_bit; sbit LCD_D5_Direction at TRISD6_bit; sbit LCD_D6_Direction at TRISD5_bit; sbit LCD_D7_Direction at TRISD4_bit; void main() { CMCON = 0x07; TRISA = 0x1F; Lcd_Init(); Delay_mS(400); Lcd_Cmd(_LCD_CLEAR); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Out(1, 1,"some text"); Delay_mS(1000); while (1) { Lcd_Cmd(_LCD_CLEAR); Lcd_Out(2, 1, "pres button"); Delay_mS(400); if (Button(&PORTA,0,1,1)) { Lcd_Cmd(_LCD_CLEAR); Lcd_Out(2,1, "+"); Delay_mS(400); } } }
Last edited by a moderator: