From 18560c240271fbf3190fd484af6f4324fde57c0b Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Sat, 4 Jul 2026 19:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0UART=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E6=A0=BC=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stm32f103c8t6/Core/Src/main.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/stm32f103c8t6/Core/Src/main.c b/stm32f103c8t6/Core/Src/main.c index a836102..f848377 100644 --- a/stm32f103c8t6/Core/Src/main.c +++ b/stm32f103c8t6/Core/Src/main.c @@ -126,16 +126,20 @@ int main(void) TURBIDITY_Calc(raw.turbidity, &tur); PH_Calc(raw.ph, &ph); - sprintf(uart_buf, - "PH=%.2f;TDS=%.2f;TUR=%.2f\r\n", - ph.ph, - tds.tds, - tur.ntu); + sprintf(uart_buf, + "UPLOAD:ph=%.2f;tds=%.2f;turbidity=%.2f\r\n", + ph.ph, + tds.tds, + tur.ntu); + HAL_UART_Transmit(&huart3, + (uint8_t*)uart_buf, + strlen(uart_buf), + 100); HAL_UART_Transmit(&huart1, - (uint8_t*)uart_buf, - strlen(uart_buf), - 100); + (uint8_t*)uart_buf, + strlen(uart_buf), + 100); HAL_Delay(500); /* USER CODE END WHILE */