Skip to content
Snippets Groups Projects
Select Git revision
  • ce166e6b68b7fafb73a99fd64081f8a4155fe22a
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

machine.ADC.rst

Blame
  • user avatar
    Paul Sokolovsky authored
    With currentmodule:: set properly, none are needed. Extra "machine." prefix
    produces wrong indexing data.
    79b40d11
    History
    machine.ADC.rst 1.97 KiB

    class ADC -- analog to digital conversion

    Usage:

    import machine
    
    adc = machine.ADC()             # create an ADC object
    apin = adc.channel(pin='GP3')   # create an analog pin on GP3
    val = apin()                    # read an analog value

    Constructors

    Methods

    class ADCChannel --- read analog values from internal or external sources

    ADC channels can be connected to internal points of the MCU or to GPIO pins. ADC channels are created using the ADC.channel method.