lighting LEDs using PIC 18f4580 in a sequence..

Thread Starter

rizwan_elias

Joined Dec 11, 2009
5
hi guys..
this is my first post..
m working on a small project..wat i want to start with is lighting leds, around 30 of them, one after the other..m using PIC 18f4580 with C..i knw this can be done by making one pin HIGH, then LOW..n doing so for all the pins..however, was wondering if ther's a simpler way to do this..appreciate ur assistance..
 

t06afre

Joined May 11, 2009
5,934
Use the shift operator in C. Take look at my pseudo code
Rich (BB code):
x=1;
//repeat this as many times as the port(s) have bits   
{
x=x<<1
//data to port
//some delay
}
Google shift operator C for more info
 
Top