Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


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 */
}