Exemplo n.º 1
0
 def set7segment(self, number):
     commandObj = CommRequest('N' + '|' + str(number))
     if number < 1 or number > 6:
         commandObj.response = 'INVALID'
         commandObj.markDone()
     else:
         self.ard.requestCommand(commandObj)
     return commandObj
Exemplo n.º 2
0
 def readSensor(self, value):
     commObject = CommRequest('S%s' % value)
     returnvalue = None
     if value == 1:
         returnvalue = self.read_distance()
     elif value == 2:
         returnvalue = self.read_electromagnetic()
     elif value == 3:
         returnvalue = self.read_capacitive()
     commObject.response = returnvalue
     commObject.markDone()
     return commObject