Esempio n. 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:]))
Esempio n. 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:]))
Esempio n. 3
0
 def stop(self):
     robotControl.stop()
Esempio n. 4
0
    def stop(self):
		robotControl.stop()