Measure analog voltages with the internal SAMD51 16-bit analog-to-digital converter (ADC)

⚙ Hardware Needed


📚 External Libraries Needed


None

📑 Code


import time
import board
from analogio import AnalogIn

analog_in = AnalogIn(board.A6)

while True:
		voltage = (analog_in.value * 3.3) / (2 ** 16)
    print(voltage)
    time.sleep(1)