Skip to content

Input Output: Get analog pin value () in ()

Jaume Olivé Petrus edited this page Oct 29, 2017 · 1 revision

This block is an Input / Output block and a Reporter block that reports the current analog value of a GPIO. The analog value can be obtained in millivolts, or in raw value.

When this block is active the GPIO is configured as an analog input.

Shape

Example

In this example a potentiometer is attached to an analog pin and every 0.5 seconds the analog value is read and displayed on the console in millivolts and in raw value. The internal ADC module (12 bits of resolution) is used, so the raw value goes from 0 to 4095.

Move the potentiometer clockwise or counterclockwise and see the changes.

Instructions:

  • Connect a potentiometer to GPIO32

Run this example in The Whitecat IDE.

Clone this wiki locally