-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathconfigure.py
More file actions
28 lines (24 loc) · 745 Bytes
/
configure.py
File metadata and controls
28 lines (24 loc) · 745 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
import json
import os.path
data={}
# Default configuration
# If you want to change make a json file that looks like
# {
# "LTRIG":"17",
# "CTRIG":"23",
# "RTRIG":"22",
# "LECHO":"18",
# "CECHO":"24",
# "RECHO":"27"
# }
data["LTRIG"] = 23 # default pin for left sonar trigger
data["CTRIG"] = 17 # default pin for center sonar trigger
data["RTRIG"] = 22 # default pin for right sonar trigger
data["LECHO"] = 24 # default pin for left sonar echo
data["CECHO"] = 18 # default pin for center sonar echo
data["RECHO"] = 27 # default pin for right sonar echo
if os.path.isfile('robot.conf'):
with open('robot.conf') as data_file:
data = json.load(data_file)
else:
print("Couldn't find robot.conf file, using default configuration")