Update read_arduino.pyw
This commit is contained in:
parent
745b475d8b
commit
94c642bfe4
|
@ -8,7 +8,7 @@ import numpy as np
|
||||||
|
|
||||||
# constant settings
|
# constant settings
|
||||||
SENSORS_MAX = 4 # maximum sensor ports
|
SENSORS_MAX = 4 # maximum sensor ports
|
||||||
baud = 9600
|
baud = 19200
|
||||||
|
|
||||||
settings = json.load(open('settings.json', 'r'))
|
settings = json.load(open('settings.json', 'r'))
|
||||||
resolution = settings["resolution"]
|
resolution = settings["resolution"]
|
||||||
|
@ -23,7 +23,7 @@ if "- No Device -" in port:
|
||||||
print("this should generate random values base on # sensors given")
|
print("this should generate random values base on # sensors given")
|
||||||
exit(0)
|
exit(0)
|
||||||
else:
|
else:
|
||||||
controller = serial.Serial(port)
|
controller = serial.Serial(port, baudrate=baud)
|
||||||
|
|
||||||
if np.any(sensor_ports >= SENSORS_MAX):
|
if np.any(sensor_ports >= SENSORS_MAX):
|
||||||
raise ValueError("Port range is 0-3!")
|
raise ValueError("Port range is 0-3!")
|
||||||
|
|
Loading…
Reference in New Issue