Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/delay.h>
- #include <avr/io.h>
- int main(void)
- {
- int tab[10];
- tab[0]=0b11000000;
- tab[1]=0b11111001;
- tab[2]=0b10100100;
- tab[3]=0b10110000;
- tab[4]=0b10011001;
- tab[5]=0b10010010;
- tab[6]=0b10000010;
- tab[7]=0b11111000;
- tab[8]=0b10000000;
- tab[9]=0b10010000;
- DDRA=0b11111111;
- DDRB=0b11111111;
- DDRD=0b00000000;
- PORTB=0b00000111; //sterowanie kolumnami
- for( ; ; )
- {
- for(int a=0;a<10;a++)
- {
- for(int b=0;b<10;b++)
- {
- for(int c=0;c<10;c++)
- {
- for(int d=0; d<10; d++)
- {
- for(int e=0;e<50;e++)
- {
- PORTB=0b00000111;
- PORTA=tab[d];
- _delay_ms(1);
- PORTB=0b00001011;
- PORTA=tab[c];
- _delay_ms(1);
- PORTB=0b00001101;
- PORTA=tab[b];
- _delay_ms(1);
- PORTB=0b00001110;
- PORTA=tab[a];
- _delay_ms(1);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement