Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LED COUNTER
- #include <mega32.h>
- #include <delay.h>
- void main(void)
- {
- int i=0;
- char arr[]={0b00111111, 0b00000110, 0b01011011, 0b01001111, 0b01100110, 0b01101101};
- DDRA=0xFF;
- DDRB=0xFF;
- while (1)
- {
- PORTA=0b11111110; // 4th selector is on
- //PORTB=0b00111111;
- //delay_ms(100);
- if(i<6)
- {
- PORTB = arr[i];
- delay_ms(250);
- i++;
- }
- else
- {
- i=0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement