code.py
 1  # SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  import time
 6  
 7  import analogio
 8  import board
 9  
10  potentiometer = analogio.AnalogIn(board.A1)
11  
12  
13  def get_voltage(pin):
14      return (pin.value * 3.3) / 65536
15  
16  
17  while True:
18      print((get_voltage(potentiometer),))
19      time.sleep(0.1)