#ISM 6106 Mini Lab 1
#Irenitemi Aruna
#This does some basic interfacing with raspberry pie
import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello,, Pi Pico!")
from Lights import *
from Button import *
from Log import *
from LightStrip import*
from Buzzer import *
from Displays import *
Log.level=NONE
"""
create intsances of all the classes in varables
"""
redled = Light(pin=20, name="red LED")
bluebutton = Button(15, "Blue")
yellowbutton = Button(14, "Yellow")
lightStrip =LightStrip(pin=2, name="Light strip", numleds=8, brightness=1)
display = LCDDisplay(sda=0, scl=1)
buzzer = PassiveBuzzer(17, name="Buzzer")
"""
Loop to check for button pushes
"""
while True:
if bluebutton.isPressed():
redled.on()
buzzer.play(200)
display.showText("LED On")
elif yellowbutton.isPressed():
lightStrip.on()
buzzer.play(1000)
display.showText("LightStrip On")
else:
redled.off()
lightStrip.off()
buzzer.stop()
display.clear()