STM32 Example

STM32 ADC Read Example

Read analog voltage using ADC.

Code Example

HAL_ADC_Start(&hadc1);

while (1)
{
  HAL_ADC_PollForConversion(&hadc1, 100);
  uint32_t value = HAL_ADC_GetValue(&hadc1);
  HAL_Delay(100);
}

How it works

This STM32 example demonstrates basic peripheral configuration and HAL usage.

Frequently asked questions

Can I use STM32CubeIDE?

Yes. These examples are intended for STM32CubeIDE and STM32 HAL drivers.

Can I modify the GPIO pins?

Yes. Update GPIO pin definitions according to your board schematic.