-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunUnit.py
More file actions
36 lines (25 loc) · 760 Bytes
/
runUnit.py
File metadata and controls
36 lines (25 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
import subprocess
import time
'''
execPath = sys.argv[1]
sketchPath = "board/arduino/arduino.ino"
boardCmd = execPath + " --port --upload " + sketchPath
subprocess.call(boardCmd, shell=True)
'''
modelNumber = sys.argv[1]
subprocess.call("cd arduino_daemon && node index.js & cd ..", shell=True)
output = subprocess.check_output("ls /dev | grep cu.usbmodem", shell=True)
splitOutput = output.split('\n')
splitOutput = splitOutput[:-1]
IO = 1421
for output in splitOutput:
num = int(output[11:])
if(num != 1411):
IO = num
arduinoPath = "Arduino/"
arduinoCmd = "cd " + arduinoPath + \
" && make && ./sheffield /dev/cu.usbmodem" + str(IO) + \
" " + modelNumber
time.sleep(10)
subprocess.call(arduinoCmd, shell=True)