Associate
August 22, 2020
Question
About Starting ADC
- 8 replies
- 2202 views
Hello.
I am using the STM32L4 series.
I want to send the ADC converted sensor value to the PC via UART communication.
I started ADC in /* USER CODE BEGIN 2 */ zone of "main.c" output from CubeIDE, but it failed.
When the start instruction is given twice as shown below, the code is executed, but the sensor value cannot be obtained.
if(HAL_ADC_Start_IT(&hadc2)!=HAL_OK){ //result: TRUE
int aaa=0;
aaa=1;
if(HAL_ADC_Start_IT(&hadc2)!=HAL_OK){ //result: FALSE...why?
aaa=0;
}
}
I am at a loss because I have no idea what the cause is.
I am sorry to trouble you, but please reply regarding this matter.
