# 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)

pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
rgb1:R
rgb1:COM
rgb1:G
rgb1:B
pot1:GND
pot1:SIG
pot1:VCC
pot2:GND
pot2:SIG
pot2:VCC
pot3:GND
pot3:SIG
pot3:VCC