import time
time.sleep(0.1) # Wait for USB to become ready

print("Hello, Pi Pico!")

from Lights import *
from Sensors import *

class SensorLight(DimLight, AnalogSensor):
    def __init__(self, lightpin, sensorpin, name):
        DimLight.__init__(self, lightpin, name + " light")
        AnalogSensor.__init__(self, sensorpin, name + " sensor")

    def operate(self):
        v = self.rawValue()
        brightness = int(v / 255)
        self.setBrightness(brightness)

l = SensorLight(lightpin =8, sensorpin = 27, name = 'Bathroom')
while True:
    l.operate()
    time.sleep(0.5)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT