ISKBoard example project
Wenxue
2025-09-02 8dd1ba5da4d68bf0d307f42379c5bd7547829e00
Core/Src/main.c
@@ -18,6 +18,8 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "adc.h"
#include "usart.h"
#include "gpio.h"
/* Private includes ----------------------------------------------------------*/
@@ -65,7 +67,7 @@
{
  /* USER CODE BEGIN 1 */
  uint32_t      lux, noisy;
  /* USER CODE END 1 */
  /* MCU Configuration--------------------------------------------------------*/
@@ -86,7 +88,10 @@
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();
  MX_ADC1_Init();
  /* USER CODE BEGIN 2 */
  init_relay();
  init_led();
@@ -99,20 +104,10 @@
  /* USER CODE BEGIN WHILE */
  while (1)
  {
     /* Blink Red Led */
     turn_led(Led_R, ON);
     HAL_Delay(200);
     turn_led(Led_R, OFF);
     HAL_Delay(200);
     adc_sample_lux_noisy(&lux, &noisy);
     printf("Lux:%lu Noisy:%lu\r\n", lux, noisy);
     /* Blink Green Led */
     toggle_led(Led_G);
     HAL_Delay(200);
     toggle_led(Led_G);
     HAL_Delay(200);
     /* Blink Blue Led */
     blink_led(Led_B, 200);
     HAL_Delay(5000);
    /* USER CODE END WHILE */