How can I print the result of and ADC conversion by a floating number in the variables section??
I want to see the value of the multiplication of my adc conversion in either the console or the variables section, I added the linker flags to be able to use the printf float and still no change. It keeps saying optimization out
Can somebody help me please?
The relevant part of the code:
int adc1
float adc2;
while (1)
{
HAL_ADC_Start(&hadc1);
/* USER CODE END WHILE */
if(HAL_ADC_PollForConversion(&hadc1,5)==HAL_OK)
{
adc1=HAL_ADC_GetValue(&hadc1);
}
adc2=((adc1/4096)*3.3);
HAL_Delay(50);
printf(“%f”, adc2);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}