hi..i got two inputs from the led..and output as lcd display..if the 1st led lights up,the lcd will display 'in' and 2nd led lights up,lcd will display 'out',if both led lights up at the same time the lcd will show blank display n every displayed result will be reset after 10 seconds..im using PIC16F877.
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;// End LCD module connectionsvoid main(){
TRISB =0x00;
PORTB =0x00;
Delay_ms(500);
LCD_Init();
LCD_Cmd(_LCD_CURSOR_OFF);
LCD_Cmd(_LCD_CLEAR);
LCD_Out(1,1,"Smart Badminton");
LCD_Out(2,2,"Line Call");while(1){
Delay_ms(3000);
LCD_Out(1,1,"In");
Delay_ms(3000);
LCD_Out(1,1,"Out");
Delay_ms(3000);
LCD_Cmd(_LCD_CLEAR);}}
i dont know how to do the coding for the led as the input in order to display the output as in,out,blank display and reset after 10 seconds after the result displayed..any idea??thank you..
LED is an output device and not input device. You should have a condition like if RB0 is 1 then LED1 (RB6) = 1 else 0 and if RB1 is 1 then LED2 is 1 else 0. You can test RB0 and RB1 values and display the text you want on LCD.
Alternately you can assign the value of LED pins to two different variables and then use these variables in a if() test and control the text to be display on LCD.