Update read_arduino.pyw

This commit is contained in:
leozone0103 2022-06-07 14:53:35 -07:00 committed by GitHub
parent 745b475d8b
commit 94c642bfe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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!")