TCSS573: loT Quiz 1 Part 3 Smart Home Dashboard v 2.0 79 Main Bedroom Turn OFF Basement Office Turn ON Living Room Turn OFF Exit 75 176 X

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How can you extend the above functionality using two additional LED modules and attaching them to the GUI where you can control the light intensity (e.g. fading) and ON/OFF operations for each LED.

the one i managed to configure is myLED5. I would to achieve an output like this from the code 

 

code 

from guizero import App,Box,Text,PushButton,Slider
from grovepi import *
import time

myLED3 = 3 #blue
myLED5 = 5 #red
myLED6 = 6 #green
pinMode(myLED3,0)
pinMode(myLED5,0)
pinMode(myLED6,0)

def exitProgram():
digitalWrite(myLED3,0)
digitalWrite(myLED5,0)
digitalWrite(myLED6,0)
app.destroy()




def SliderToggleLED5(slider_value):
analogWrite(myLED5, int(slider_value))


def led1Toggle():
button_status = digitalRead(myLED5)
if (button_status == 0):
 digitalWrite(myLED5,1)
 ledButton1.text ="Turn off"
 ledButton1.bg ="green"
 ledButton1.text_color="white"
 textLED5.color ="green"

else:
 
 digitalWrite(myLED5,0)
 ledButton1.text ="Turn off"
 ledButton1.bg ="red"
 ledButton1.color="black"
 
 
app = App(title="TCSS573: IOT Quiz Part 3", height =300, width = 500)
main =Text(app, text ="Smart Home Dashboard Ver 1.0", size=14, font="Time New Roman", color="navy")
box = Box(app, layout ="grid", grid =[1,0])

textLED5 = Text(box, text="Main Bedroom", align ="left", grid =[0,0])
ledButton1 =PushButton(box, command=led1Toggle, text="Turn ON", grid=[1,0])
sliderLED5=Slider(box, start=0, end =255, command = SliderToggleLED5, grid=[4,0])

 


exitButton = PushButton(box, command=exitProgram , text="Exit", grid=[2,8])
app.display()

TCSS573: loT Quiz 1 Part 3
Smart Home Dashboard v 2.0
Turn OFF
79
Main Bedroom
Basement Office Turn ON
Living Room
Turn OFF
Exit
75
176
X
Transcribed Image Text:TCSS573: loT Quiz 1 Part 3 Smart Home Dashboard v 2.0 Turn OFF 79 Main Bedroom Basement Office Turn ON Living Room Turn OFF Exit 75 176 X
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education