my project if press the switch the message in LCD will appear but here the message appear before pressing Why? What is the problem ?
this is my code in MikroC
Code: Select all
char *text = "Hello world";
void main(){
TRISD=0xff;
while(1){
if(portd.f0==0){
Lcd_Init(&PORTB);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Out(2,1,text);
}
}
}