Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

define the leds and output in lcd display using PIC 16f877

Status
Not open for further replies.

rascal_141

Junior Member level 1
Junior Member level 1
Joined
Feb 18, 2014
Messages
19
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Visit site
Activity points
121
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.

this is the coding for lcd display


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
// 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 connections
 
void 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..
 
Last edited by a moderator:

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.
 

(RB6)??are you mean that a condition like if RB0 is 1 then LED1 (RB0) = 1 else 0 and if RB1 is 1 then LED2 is 1 else 0??
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top