Microcontroller › AVR › how to make running led using atmega16 › i think it is also can be
February 18, 2011 at 9:26 am
#5551
Amit Joshi
Participant
i think it is also can be done by
// for left shift
for(i=0;i<6;i++)
{
PORTx = (PORTx<<1);
_delay_ms(1000);
}
// for right shift
for(i=0;i<6;i++)
{
PORTx = (PORTx<<1);
_delay_ms(1000);
}
// for cicular shift
while(1)
{
PORTx = (PORTx<<1)|(PORTx>>7);
_delay_ms(1000);
}