STM32 HAL PlatformIO LED 闪烁示例
在自动生成的 main.c 中,使用以下 while() 循环:
stm32_blink.c
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_GPIO_WritePin(LD1_GPIO_Port, LD1_Pin, GPIO_PIN_SET);
HAL_Delay(1000);
HAL_GPIO_WritePin(LD1_GPIO_Port, LD1_Pin, GPIO_PIN_RESET);
HAL_Delay(1000);
}
/* USER CODE END 3 */在 STM32H7 Nucleo 板上,这将切换绿色 LED。
Check out similar posts by category:
C/C++, PlatformIO, STM32
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow