Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(void) {
- oled_Init();
- char buf = 0;
- char buffer[32];
- for (int i = 0; i < 32; i++) buffer[i] = '\0';
- while (1)
- {
- HAL_StatusTypeDef state = HAL_UART_Receive(&huart1, &buf, 1, 50);
- if (state == HAL_OK) {
- switch (buf) {
- case 13: oled_GotoNextLine(Font_7x10); break;
- case 127: oled_DeleteLastChar(Font_7x10, Black); break;
- default:
- oled_WriteChar(buf, Font_7x10, White);
- break;
- }
- oled_UpdateScreen();
- }
- /* USER CODE END WHILE */
- /* USER CODE BEGIN 3 */
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement