canon_ble #82

Merged
mattmcw merged 149 commits from canon_ble into main 2023-08-01 03:38:52 +00:00
3 changed files with 4746 additions and 6 deletions
Showing only changes of commit 95cde2907a - Show all commits

1
notes/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
env

4738
notes/debug.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,20 +5,21 @@ import serial.tools.list_ports
ports = serial.tools.list_ports.comports()
port = ''
for p in ports:
print p
if "Arduino" in p.description:
print "This is an Arduino!"
print(p)
if "Arduino" in p.description or 'ACM0' in p.description:
print("This is an Arduino!")
port = p.device
break
if p is '':
if port == '':
print("Arduino is not connected")
exit(1)
arduino = serial.Serial(port=port, baudrate=57600, timeout=.05)
time.sleep(1)
while arduino.in_waiting: # Or: while ser.inWaiting():
print arduino.readline()
with open('debug.csv', 'w') as file:
while True: # Or: while ser.inWaiting():
file.write(arduino.readline().decode())