Advertisement
jh_elec

Untitled

Jun 9th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. void scrollMessage( char *str )
  2. {
  3.     char message[] = "123456789121345678";
  4.     uint8_t leng = strlen(message);
  5.    
  6.     for ( int8_t i = 0 ; i < leng + 4 ; i++ )
  7.     {
  8.         if ( i > leng )
  9.         {
  10.             disp.dig[0] = 11;
  11.             disp.dig[1] = 11;
  12.             disp.dig[2] = 11;
  13.             disp.dig[3] = 11;          
  14.         }
  15.         else
  16.         {
  17.             disp.dig[0] = message[ 0 + i ] - '0';
  18.             disp.dig[1] = message[ 1 + i ] - '0';
  19.             disp.dig[2] = message[ 2 + i ] - '0';
  20.             disp.dig[3] = message[ 3 + i ] - '0';          
  21.         }
  22.        
  23.         _delay_ms(250);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement