Artemis Development with the Arduino IDE

Pages
Contributors: santaimpersonator, Liquid Soulder, Member #1571936
Favorited Favorite 3

ADC: AnalogRead

The ADC pins are useful for measuring analog voltage inputs. To get started, we have provided a built-in example for the Apollo3 core. From the file drop-down menu: File > Examples > Apollo3 > AnalogRead.

ADC example
Built-in AnalogRead example for the Apollo3 core.

Wiring

Users should be familiar with the ADC example in the SIK. Please, remember that some boards are rated at 3.3V; and therefore, the potentiometer should be tied to 3.3V on the high side.

Operation: Serial Monitor

This example outputs ADC values to the serial monitor, through the USB connection of the associated board. Follow the steps for programming the associated board to see the code in action.

Once the board is programmed, open the serial monitor on the Arduino IDE; make sure to set the baud rate to 115200 baud. A 14-bit value should be printed out based on the associated ADC input voltage.

ADC demo
A print out of the voltage measured by the ADC pin, on the Arduino IDE Serial Monitor.