This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

machine.ADCWiPy

Classes

ADCWiPy

Create an ADC object associated with the given pin.

adcchannel

Module Contents

class machine.ADCWiPy.ADCWiPy(id=0, *, bits=12)

Create an ADC object associated with the given pin. This allows you to then read analog values on that pin. For more info check the pinout and alternate functions table.

adcchannel() Incomplete

Fast method to read the channel value.

channel(id, *, pin) Incomplete

Create an analog pin. If only channel ID is given, the correct pin will be selected. Alternatively, only the pin can be passed and the correct channel will be selected. Examples:

# all of these are equivalent and enable ADC channel 1 on GP3
apin = adc.channel(1)
apin = adc.channel(pin='GP3')
apin = adc.channel(id=1, pin='GP3')
deinit() None

Disable the ADC block.

init() None

Enable the ADC block.

class machine.ADCWiPy.adcchannel
deinit() None

Disable the ADC channel.

init() Incomplete

Re-init (and effectively enable) the ADC channel.

value() Incomplete

Read the channel value.