# RGB WITH 3 Potentiometers
from machine import PWM, Pin, ADC
from time import sleep
redLED = 16
greenLED = 17
blueLED = 18
pot1 = 28
pot2 = 27
pot3 = 26
myPot1 = ADC(pot1)
myPot2 = ADC(pot2)
myPot3 = ADC(pot3)
rLED = PWM(Pin(redLED))
gLED = PWM(Pin(greenLED))
bLED = PWM(Pin(blueLED))
rLED.freq(1000)
gLED.freq(1000)
bLED.freq(1000)
while True:
potVal1 = myPot1.read_u16()
potVal2 = myPot2.read_u16()
potVal3 = myPot3.read_u16()
rLED.duty_u16(int(potVal1))
gLED.duty_u16(int(potVal2))
bLED.duty_u16(int(potVal3))
print(potVal1, potVal2, potVal3)
sleep(.1)