Exemple #1
0
 def receiveMessage(self, msg):
     if msg == 'exit':
         robotControl.terminate()
     elif msg=="stop":
         robotControl.stop()
     elif 'A'==msg[0] and 'B' in msg:
             #Messages are like 'A13B68' + (new line character) + perhaps more if something's wrong
             #TODO: Some more error handeling here perhaps?
             bpos = msg.find('B')
             robotControl.motorA.pwmControl(int(msg[1:bpos]))
             if 'A' in msg[bpos+1:]: #If there are more messages sent at a time
                 robotControl.motorB.pwmControl(int(msg[bpos+1:msg[bpos+1:].find('A')+bpos+1]))
             else:
                 robotControl.motorB.pwmControl(int(msg[bpos+1:]))
Exemple #2
0
 def receiveMessage(self, msg):
     if msg == 'exit':
         robotControl.terminate()
     elif msg == "stop":
         robotControl.stop()
     elif 'A' == msg[0] and 'B' in msg:
         #Messages are like 'A13B68' + (new line character) + perhaps more if something's wrong
         #TODO: Some more error handeling here perhaps?
         bpos = msg.find('B')
         robotControl.motorA.pwmControl(int(msg[1:bpos]))
         if 'A' in msg[bpos +
                       1:]:  #If there are more messages sent at a time
             robotControl.motorB.pwmControl(
                 int(msg[bpos + 1:msg[bpos + 1:].find('A') + bpos + 1]))
         else:
             robotControl.motorB.pwmControl(int(msg[bpos + 1:]))
Exemple #3
0
 def stop(self):
     robotControl.stop()
Exemple #4
0
    def stop(self):
		robotControl.stop()