Advertisement
Guest User

a

a guest
Nov 13th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. int main(void) {
  2. oled_Init();
  3. char buf = 0;
  4. char buffer[32];
  5. for (int i = 0; i < 32; i++) buffer[i] = '\0';
  6. while (1)
  7. {
  8. HAL_StatusTypeDef state = HAL_UART_Receive(&huart1, &buf, 1, 50);
  9. if (state == HAL_OK) {
  10. switch (buf) {
  11. case 13: oled_GotoNextLine(Font_7x10); break;
  12. case 127: oled_DeleteLastChar(Font_7x10, Black); break;
  13. default:
  14. oled_WriteChar(buf, Font_7x10, White);
  15. break;
  16. }
  17. oled_UpdateScreen();
  18. }
  19. /* USER CODE END WHILE */
  20.  
  21. /* USER CODE BEGIN 3 */
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement