添加ADC采集电压和RGB灯

This commit is contained in:
2024-03-08 15:19:23 +08:00
parent 7749d1d7b7
commit fa1cc826f1
14 changed files with 1189 additions and 915 deletions

View File

@ -18,6 +18,7 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "adc.h"
#include "spi.h"
#include "tim.h"
#include "usart.h"
@ -94,10 +95,11 @@ int main(void)
MX_SPI1_Init();
MX_SPI2_Init();
MX_TIM4_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
mymain();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
@ -133,6 +135,10 @@ void SystemClock_Config(void)
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Macro to configure the PLL clock source
*/
__HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE);
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/