Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter.colorchooser import *
- import colorInterface
- def setColor(value):
- colorInterface.sendColorCommand(0, int(value))
- def setBrightness(value):
- colorInterface.sendBrightnessCommand(0, int(value))
- def Show():
- window = Tk()
- window.title('Lichtsteuerung')
- window.configure(height=400,width=600)
- btnOn = Button(window,text=' On ', command=colorInterface.sendOnCommand)
- btnOff = Button(window,text=' Off ', command=colorInterface.sendOffCommand)
- btnWhite = Button(window,text='White', command=colorInterface.sendWhiteCommand)
- btnFunc = Button(window,text='Function', command=colorInterface.sendDiscoCommand)
- btnFuncSlow = Button(window,text='Function Slower', command=colorInterface.sendDiscoDecCommand)
- btnFuncFast = Button(window,text='Function Faster', command=colorInterface.sendDiscoIncCommand)
- slideBrightness = Scale(window, from_=0, to=18, orient=HORIZONTAL, command=setBrightness)
- slideBrightness.set(18)
- slideColor = Scale(window, from_=0, to=255, orient=HORIZONTAL, command=setColor)
- btnOn.pack(side=TOP)
- btnOff.pack(side=TOP)
- btnWhite.pack(side=TOP)
- btnFunc.pack(side=TOP)
- btnFuncSlow.pack(side=TOP)
- btnFuncFast.pack(side=TOP)
- slideColor.pack(side=BOTTOM)
- slideBrightness.pack(side=BOTTOM)
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement