dear all,
i am using PIC16F877A. i want that wen switch at B0 is pressed it shud display the count and wen switch at B1 is pressed it shud print the text on LCD. but the count n and the text appear on lcd without pressing any of the switches.even though the switches are pressed, the programm runs..
can anybody help..plz
i am using PIC16F877A. i want that wen switch at B0 is pressed it shud display the count and wen switch at B1 is pressed it shud print the text on LCD. but the count n and the text appear on lcd without pressing any of the switches.even though the switches are pressed, the programm runs..
can anybody help..plz
Rich (BB code):
int i;
char txt[2];
void main()
{
i = 0;
PORTD = 0;
LCD_Config(&PORTD,1,0,2,7,6,5,4);
PORTB = 0;
TRISB = 0b00000011;
{
do
{
if(PORTB.F0 == 0)
{
LCD_Cmd(LCD_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
IntToStr(i, txt);
Lcd_Out(2,2 ,txt);
i=i+1;
delay_ms(500);
}
if ( PORTB.F1 == 0)
{
LCD_Cmd(LCD_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
LCD_Out(1,4, "DINNAR BOX");
LCD_Out(2,1,"GOLD DINNAR BOX !");
Delay_ms(1000);
}
}while(1);
}
}