Skip to content

Commit c9a80ee

Browse files
committed
tkinter and arduino
1 parent d752084 commit c9a80ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tkinter_led_cont.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
red = board.get_pin("d:13:o")
1010
white = board.get_pin("d:12:o")
1111
yellow = board.get_pin("d:11:o")
12-
m = Tk()
12+
m = Tk()#to create tkinter window
1313
#function for different led
1414
def led(args):
1515
if args == 1:
@@ -38,7 +38,7 @@ def led(args):
3838
refresh()
3939
#tkinter code
4040
m.title("GUI + Arduino")
41-
m.geometry("600x600")
41+
m.geometry("600x600")#size of the window # its "x" not "*"
4242
thelabel = Label(m, text = "Welcome to led simulation!")
4343
thelabel.pack(side = TOP)
4444
b1 = Button(m, text = "RED LED ON", command = lambda: led(1)) # if the fucntions were definded individually/n
@@ -54,7 +54,7 @@ def led(args):
5454
b6 = Button(m, text = "YELLOW LED OFF", command = lambda: led(6))
5555
b6.pack()
5656

57-
def refresh(m):
57+
def refresh(m):#function to refresh the window after every button click so the window doesn't close
5858
m.destroy()
5959
m.__init__()
6060
m.mainloop()

0 commit comments

Comments
 (0)