Initial commit

This commit is contained in:
Lucas Oskorep
2022-06-07 19:18:54 -04:00
commit b5257f84a6
5 changed files with 66 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from serial import Serial
import serial.tools.list_ports as port_list
ports = list(port_list.comports())
#Windows code for figuring out which port to grab
for port in ports:
if "DF60BCA" in port.hwid and port.pid == 33032:
print("FOUND MACROPAD!")
ser = Serial(port.name)
ser.write(b"hello!\n")
line = ser.readline()
print(line)
print(line.decode("utf-8"))
line = ser.readline()
print(line)
print(line.decode("utf-8"))
line = ser.readline()
print(line)
print(line.decode("utf-8"))
line = ser.readline()
print(line)
print(line.decode("utf-8"))
ser.close()