Select Git revision
machine.ADCBlock.rst
Forked from
flow3r / flow3r firmware
1529 commits behind, 14669 commits ahead of the upstream repository.

moon2 authored
machine.ADCBlock.rst 1.82 KiB
class ADCBlock -- control ADC peripherals
The ADCBlock class provides access to an ADC peripheral which has a number of channels that can be used to sample analog values. It allows finer control over configuration of :ref:`machine.ADC <machine.ADC>` objects, which do the actual sampling.
This class is not always available.
Example usage:
from machine import ADCBlock
block = ADCBlock(id, bits=12) # create an ADCBlock with 12-bit resolution
adc = block.connect(4, pin) # connect channel 4 to the given pin
val = adc.read_uv() # read an analog value