Untitled
Never
from tkinter import * import os import time import socket root = Tk() #### Funciones Botones: def funcW(event): print("W") #return movs(1) def funcA(event): print("A") #return movs(2) def funcS(event): print("S") #return movs(3) def funcD(event): print("D") #return movs(4) ###Omita funcion, no se si va a servir jaja, solo mando el selec segun a tecla que se presiona para mandara a arduino """ def movs(selec): byte = [1, 1, 1, 1, 1, 1, 0, 0] s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.100.6", 7070) while True: if(selec == 1): valor = 1023 ##No se cual potencia es para adelante s.send(valor.encode("utf-8")) elif(selec == 2): valor = -1 s.send(valor.encode("utf-8")) elif(selec == 3): valor = 422 ##No se cual potencia es para atras s.send(valor.encode("utf-8")) elif(selec == 4): valor = 1 s.send(valor.encode("utf-8")) else: break """ #### Botones: btn_arriba = Button(root, text="W", bg="#2e3131", fg= "White", relief ="flat", width = 6, height = 3) root.bind("<w>", funcW) btn_arriba.place(x=100, y=427) btn_izquierda = Button(root, text="A", bg="#2e3131", fg= "White", relief ="flat", width = 6, height = 3) root.bind("<a>", funcA) btn_izquierda.place(x=45, y=485) btn_abajo = Button(root, text="S", bg="#2e3131", fg= "White", relief ="flat", width = 6, height = 3) root.bind("<s>", funcS) btn_abajo.place(x=100, y=485) btn_derecha = Button(root, text="D", bg="#2e3131", fg= "White", relief ="flat", width = 6, height = 3) root.bind("<d>", funcD) btn_derecha.place(x=155, y=485) ### Nombre y nacionalidad del piloto: user_name = "Nombre" ### Se puede obtener de un get entry name_label=Label(root, text = user_name, bg="#2e3131", fg="White",width = 15, height = 2,anchor="e") name_label.place(x=670,y=20) nacionalidad = "Nacionalidad" ### Se puede obtener de un get entry name_label=Label(root, text = nacionalidad, bg="#2e3131", fg="White",width = 15, height = 2, anchor="e") name_label.place(x=670,y=60) ###Luces: btn_freno = Button(root, text = "Fren", bg="#d91e18", relief ="flat", width = 6, height = 3) btn_freno.place(x=670, y = 100) btn_delanteras = Button(root, text = "Fron", bg= "#e8ecf1", relief ="flat", width = 6, height = 3) btn_delanteras.place(x=730, y = 100) btn_lucIzq = Button(root, text = "Izq", bg="#f5e51b", relief ="flat", width = 6, height = 3) btn_lucIzq.place(x=670, y = 160) btn_lucDer = Button(root, text = "Der", bg= "#f5e51b", relief ="flat", width = 6, height = 3) btn_lucDer.place(x=730, y = 160) bg_image = PhotoImage(file = r"C:\Users\brand\Documents\Taller e intro\Project3\image.jfif") bg_label = Label(root, image = bg_image) bg_label.place(x=0, y=0, relwidht = 1, relheight = 1) root.minsize(800, 600) root.resizable(width=NO, height=NO) root.configure(bg="Black") root.mainloop()
Raw Text
-
https://www.facebook.com/TryFitSpressoUnitedStates/
8 min ago
-
Adult Telegram Channels
11 min ago
-
Hailey Rose asks, "Can you help wipe this paint from my boobs Stepbro?" -S5:E9
18 min ago
-
3 Ways Create Better GLYCOGEN CONTROL AUSTRALIA With The Help Of Your Dog
28 min ago
-
jVawlia
36 min ago
-
https://www.facebook.com/GetGreenAcresCBDGummies/
36 min ago
-
ryytur dtfsd dghg
37 min ago
-
The Economic Impact of Glycogen-Related Health Issues
41 min ago
-
Billionaire Brain Wave
41 min ago
-
tehaer
51 min ago