1
0
Fork 0

load presets from config file

This commit is contained in:
Kevin Matz 2019-07-30 11:06:17 -04:00
parent be3d4841cb
commit 9c8477b755
2 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,8 @@ logger.addHandler(ch) # add console log handler
# load configuration
config = configparser.ConfigParser(allow_no_value=True)
config.read('robot.cfg') # open config file
r.config = config['robot'] # section of config file
r.config = config['robot'] # robot section of config file
r.preset = config['presets'] # presets section of config file
r.start() # open port, start read thread
script = ArmCtlListener(r)

View File

@ -27,6 +27,7 @@ class Robot:
def __init__(self):
self.serial_port = None
self.config = None
self.preset = None
self.serial_read_thread = None
self.angle = []
self.target = []