class ADC - analog to digital converterΒΆ


from robot_hat import ADC

adc = ADC("A0")                     # create an analog object from a pin
val =                    # Read values from analog pins


class robot_hat.ADC(pin): Create an ADC object associated with the given pin. This allows you to then read analog values on that pin.


  • read - Read the value on the analog pin and return it. The returned value will be between 0 and 4095.