The ADC Example demonstrates the use of the analog-to-digital converter (ADC) peripheral in a simple way. It uses the ADC driver.
The example initializes ADC and constantly samples the analog input 2 on pin 1. The output is printed on UART. The example is event-driven, which means that no busy loops are used. Therefore, the CPU can be turned off during inactive periods.
The provided event handler is called by the driver when a new sampling result is available. The result is enclosed in a proper text message and transmitted via UART. The main loop of the example is empty. It is used only to put the CPU into low-power consumption mode.
You can find the source code and project file of the example in the following folder: <InstallFolder>\examples\peripheral\adc
Test the ADC HAL Example application by performing the following steps: