analogio — Analog hardware supportΒΆ

The analogio module contains classes to provide access to analog IO typically implemented with digital-to-analog (DAC) and analog-to-digital (ADC) converters.

Libraries

All libraries change hardware state and should be deinitialized when they are no longer needed. To do so, either call deinit() or use a context manager.

For example:

import analogio
from board import *

with analogio.AnalogIn(A0) as pin:
  print(pin.value)

This example will initialize the the device, read value and then deinit() the hardware.