Created
December 3, 2018 16:07
-
-
Save aula9/9d7c911731958d4d2ee2c2e553c5400d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
import time | |
import RPi.GPIO as io | |
io.setmode(io.BOARD) | |
io.setwarnings(False) | |
Top = Tk() | |
io.setup(11,io.OUT) | |
io.setup(15,io.OUT) | |
io.setup(13,io.OUT) | |
pr = io.PWM(11,50) | |
pr.start(5) | |
pg = io.PWM(15,50) | |
pg.start(5) | |
pb = io.PWM(13,50) | |
pb.start(5) | |
def updater1(): | |
dutyr = w1.get() | |
pr.ChangeDutyCycle(float(dutyr)) | |
print(dutyr) | |
def updater2(): | |
dutyg = w2.get() | |
pg.ChangeDutyCycle(float(dutyg)) | |
print(dutyg) | |
def updater3(): | |
dutyb = w3.get() | |
pb.ChangeDutyCycle(float(dutyb)) | |
print(dutyb) | |
w1 = Scale(Top ,from_=0,to =100,orient = HORIZONTAL ,length =500,tickinterval=5) | |
w1.set(5) | |
w1.pack() | |
w2 = Scale(Top ,from_=0,to =100,orient = HORIZONTAL,length =500,tickinterval=5) | |
w2.set(5) | |
w2.pack() | |
w3 = Scale(Top ,from_=0,to =100,orient = HORIZONTAL,length =500,tickinterval=5) | |
w3.set(5) | |
w3.pack() | |
mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment