Guest User

Untitled

a guest
Apr 15th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. // --------------------------------------------------------
  2.  
  3. #define LEN_HEART 10
  4.  
  5. void heart(void)
  6. {
  7.     uint8_t sign_heart[LEN_HEART] =
  8.     {  
  9.         0b00000000,
  10.         0b00001100,
  11.         0b00011110,
  12.         0b00111110,
  13.         0b01111100,
  14.         0b11111000,
  15.         0b01111100,
  16.         0b00111110,
  17.         0b00011110,
  18.         0b00001100,
  19.     };  
  20.  
  21.     int i = 0;
  22.     while(1)
  23.     {  
  24.         reg_leds = sign_heart[i];
  25.  
  26. #if 0
  27.         print_hex(sign_heart[i], 2);
  28.         print("  ");
  29.         print_hex(i, 2);
  30.         print("\n");
  31. #endif
  32.  
  33.         i++;
  34.         i %= LEN_HEART;
  35.         int t = 100;
  36.         while (t--) __asm__ volatile ("nop");
  37.     }  
  38. }
  39.  
  40. // --------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment