Created
May 18, 2017 17:03
-
-
Save kelliott121/2cfaeb08006bc5e3f81fbe822cb425fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller: | |
"""docstring for Controller""" | |
NumButtons = 8 | |
def __init__(self, devName, devKeys): | |
self.devPath = "/dev/" + devName | |
try: | |
print "Connecting to " + self.devPath | |
self.serial = serial.Serial(self.devPath, 9600, timeout=10) | |
except Exception as inst: | |
print type(inst) # the exception instance | |
print inst.args # arguments stored in .args | |
print inst | |
print "Connection to " + self.devPath + " failed!" | |
self.connected = False | |
else: | |
print "Connection to " + self.devPath + " successful!" | |
self.connected = True | |
self.devKeys = devKeys | |
self.device = Device(devKeys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment