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.

How to put 8 LEDs on port B of PIC16F877A and turn them on with mikroC code?

Status
Not open for further replies.

os12

Newbie level 2
Joined
Jun 26, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
hi,
please can anay one tell me how to put 8 leds on port B and to make them turned on one by one using mikroc ,, i am using pic16f877a,and any one knows any books for explaining mikroc language
thanks
 

mikroc code

hi,

from this site u can download the documents describing about mikroc

**broken link removed**
 

    os12

    Points: 2
    Helpful Answer Positive Rating
Re: help on mikroc code

os12 said:
hi,
please can anay one tell me how to put 8 leds on port B and to make them turned on one by one using mikroc ,, i am using pic16f877a,and any one knows any books for explaining mikroc language
thanks

It goes back and forth.....Knight Rider style...

unsigned int i=1;

void main() {
PORTB = 0;
TRISB = 0;

while(1){
for(i=1;i<=128;i=i*2){
PORTB=i;
delay_ms(100);
}
for(i=128;i>1;i=i/2){
PORTB=i;
delay_ms(100);
}
}
}
 
  • Like
Reactions: uomsama

    os12

    Points: 2
    Helpful Answer Positive Rating

    uomsama

    Points: 2
    Helpful Answer Positive Rating
Re: help on mikroc code

thanx alot (dilraj.n),
i downloaded the pdf , thanxx[/quote]

Added after 48 minutes:

thanxx for the code



hugo said:
os12 said:
hi,
please can anay one tell me how to put 8 leds on port B and to make them turned on one by one using mikroc ,, i am using pic16f877a,and any one knows any books for explaining mikroc language
thanks

It goes back and forth.....Knight Rider style...

unsigned int i=1;

void main() {
PORTB = 0;
TRISB = 0;

while(1){
for(i=1;i<=128;i=i*2){
PORTB=i;
delay_ms(100);
}
for(i=128;i>1;i=i/2){
PORTB=i;
delay_ms(100);
}
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top