Advertisement
Guest User

123456

a guest
Mar 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #include <avr/delay.h>
  2. #include <avr/io.h>
  3.  
  4.  
  5.  
  6. int main(void)
  7. {
  8. int tab[10];
  9. tab[0]=0b11000000;
  10. tab[1]=0b11111001;
  11. tab[2]=0b10100100;
  12. tab[3]=0b10110000;
  13. tab[4]=0b10011001;
  14. tab[5]=0b10010010;
  15. tab[6]=0b10000010;
  16. tab[7]=0b11111000;
  17. tab[8]=0b10000000;
  18. tab[9]=0b10010000;
  19.  
  20. DDRA=0b11111111;
  21. DDRB=0b11111111;
  22. DDRD=0b00000000;
  23.  
  24. PORTB=0b00000111; //sterowanie kolumnami
  25.  
  26. for( ; ; )
  27. {
  28.  
  29. for(int a=0;a<10;a++)
  30. {
  31. for(int b=0;b<10;b++)
  32. {
  33. for(int c=0;c<10;c++)
  34. {
  35. for(int d=0; d<10; d++)
  36. {
  37. for(int e=0;e<50;e++)
  38. {
  39. PORTB=0b00000111;
  40. PORTA=tab[d];
  41. _delay_ms(1);
  42. PORTB=0b00001011;
  43. PORTA=tab[c];
  44. _delay_ms(1);
  45. PORTB=0b00001101;
  46. PORTA=tab[b];
  47. _delay_ms(1);
  48. PORTB=0b00001110;
  49. PORTA=tab[a];
  50. _delay_ms(1);
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement