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