Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include "stm32l4xx.h"
  2. #include "stm32l476g_discovery.h"
  3. #include "stdio.h"
  4. #include "string.h"
  5. #include "stm32l476xx.h"
  6. #include "stm32l476g_discovery.h"
  7. #include "stm32l476g_discovery_gyroscope.h"
  8. #include "stm32l476g_discovery_glass_lcd.h"
  9. #include "stm32l476g_discovery_audio.h"
  10. #include "stm32l476g_discovery_qspi.h"
  11. #include <math.h>
  12.  
  13.  
  14.  
  15. uint8_t buffer[6];
  16.  
  17. void copyToBuffer(int number){
  18.  
  19. int n = log10(number) + 1;
  20. int i;
  21.  
  22. for ( i = 0; i < n; ++i, number /= 10 )
  23. {
  24. buffer[i] = '0' + number % 10;
  25. }
  26. }
  27.  
  28.  
  29. int main(void) {
  30.  
  31. BSP_LCD_GLASS_Init();
  32.  
  33. for(uint32_t i = 0; i < 999999;i++){
  34. copyToBuffer(i);
  35. BSP_LCD_GLASS_DisplayString(buffer);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement