ADC Class
This document introduces the ADC class in the PinPong library, including how to initialize an ADC object and read analog values from a specified analog pin.
ADC Class
Constructor
Creates and initializes an ADC (Analog-to-Digital Converter) to get analog data.
adc = ADC(board, Pin(board, Pin.A0))
- board: The board object created by the PinPong class. This parameter can be omitted if there is only one board.
- Pin: The pin object created by the Pin class.
Methods
adc.read()
Reads the analog value from the ADC. For example,
brightness = adc.read()
Was this article helpful?
