from machine import Pin, ADC
import time
# Initialize ADC for potentiometers
pot1 = ADC(Pin(34)) # $VR_1$ WIPER connected to GPIO26_ADC0
pot2 = ADC(Pin(35)) # $VR_2$ WIPER connected to GPIO27_ADC1
# Initialize GPIO for diodes
led1 = Pin(3, Pin.OUT) # $D_1$ Cathode connected to GPIO3
led2 = Pin(4, Pin.OUT) # $D_2$ Cathode connected to GPIO4
led3 = Pin(5, Pin.OUT) # $D_3$ Cathode connected to GPIO5
led4 = Pin(6, Pin.OUT) # $D_4$ Cathode connected to GPIO6
led5 = Pin(7, Pin.OUT) # $D_5$ Cathode connected to GPIO7
while True:
# Read potentiometer values
pot1_value = pot1.read_u16() # Read 16 - bit ADC value
pot2_value = pot2.read_u16() # Read 16 - bit ADC value
# Print potentiometer values
print('Pot 1:', pot1_value)
print('Pot 2:', pot2_value)