Advertisement
dzieciol

zadanie 2

Oct 20th, 2017
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #include<avr/io.h>
  2.  
  3. int main(void){
  4.     DDRA = 0xFF;
  5.     DDRB = 0x0F;
  6.     unsigned char wezyk[10];
  7.     wezyk[0] = 0b01000111;//E
  8.     wezyk[1] = 0b01001110;//r
  9.     wezyk[2] = 0b01000111;//o
  10.     //PORTA = wezyk[1];
  11.     //PORTB = 0b00000111;
  12.     unsigned char ruchy[4][4] =
  13.     {
  14.         {0b01000111,0b11111111, 0b11111111,0b11111111},
  15.         {0b01001110,0b11111111, 0b11111111,0b11111111},
  16.         {0b01011110,0b11111110, 0b11111111,0b11111111},
  17.         {0b01111110,0b11111110, 0b11111110,0b11111111}
  18.     };
  19.        
  20. for(;;){
  21. for(unsigned char j= 0 ; j < 4 ; j++){
  22.    
  23.     for (unsigned char i = 0; i<4 ; i++){
  24.         PORTB = ~(_BV(3-i));
  25.         PORTA = ruchy[j][i];
  26.         for(unsigned long i=0; i<=10;i++){
  27.                 __asm__ ( "nop;");
  28.             }
  29.     }
  30.     for(unsigned long i=0; i<=8000;i++){
  31.                 __asm__ ( "nop;");
  32.             }
  33.  
  34.    
  35. }
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement