code.py
 1  # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  """
 6  Read the potentiometer value. Prints the value to the serial console every two seconds.
 7  
 8  REQUIRED HARDWARE:
 9  * potentiometer on pin GP26.
10  """
11  import time
12  import board
13  import analogio
14  
15  potentiometer = analogio.AnalogIn(board.GP26)
16  
17  while True:
18      print(potentiometer.value)
19      time.sleep(2)