Beispiel #1
0
 def basicMotorStart(self, way):
     util.traceCall()
     if util.getDebug() > 0:
         return
     if way == self._way[1] or way == 1:
         self.basicMotorBackward()
     else:
         self.basicMotorForward()
Beispiel #2
0
 def motorStop(self):
     util.traceCall()
     if util.getDebug() > 0:
         return
     util.trace("_pwmMotorForward.ChangeDutyCycle to stop")
     util.trace("_pwmMotorBackward.ChangeDutyCycle to stop")
     self._pwmMotorForward.ChangeDutyCycle(self._stopCycle)
     self._pwmMotorBackward.ChangeDutyCycle(self._stopCycle)
Beispiel #3
0
def leftMotorSpeed(speed_f, speed_b):
	util.trace("lib_motors_evol.leftMotorSpeed with speed_f=" + str(speed_f) + " and speed_b=" + str(speed_b))
	if util.getDebug() > 0:
		return
	if 1 <= speed_f <= speed_max:
		pwmMotorLeftForwards.ChangeDutyCycle(DutyCycleLeft * speed_f)
	else:
		pwmMotorLeftForwards.ChangeDutyCycle(Stop)
	if 1 <= speed_b <= speed_max:
		pwmMotorLeftBackwards.ChangeDutyCycle(DutyCycleLeft * speed_b)
	else:
		pwmMotorLeftBackwards.ChangeDutyCycle(Stop)
Beispiel #4
0
 def motorUpdate(self):
     util.traceCall()
     if util.getDebug() > 0:
         return
     if self._curWay == 0:
         # forward
         util.trace("_pwmMotorForward.ChangeDutyCycle to " +
                    str(self._dutyCycle * self._curSpeed))
         util.trace("_pwmMotorBackward.ChangeDutyCycle to stop")
         self._pwmMotorForward.ChangeDutyCycle(self._dutyCycle *
                                               self._curSpeed)
         self._pwmMotorBackward.ChangeDutyCycle(self._stopCycle)
     else:
         # backward
         util.trace("_pwmMotorForward.ChangeDutyCycle to stop")
         util.trace("_pwmMotorBackward.ChangeDutyCycle to " +
                    str(self._dutyCycle * self._curSpeed))
         self._pwmMotorForward.ChangeDutyCycle(self._stopCycle)
         self._pwmMotorBackward.ChangeDutyCycle(self._dutyCycle *
                                                self._curSpeed)
Beispiel #5
0
 def basicMotorBackward(self):
     util.traceCall()
     if util.getDebug() > 0:
         return
     GPIO.output(self._pinForward, 0)
     GPIO.output(self._pinBackward, 1)
Beispiel #6
0
def stopRightMotor():
	util.trace("lib_motors_evol.stopRightMotor")
	if util.getDebug() > 0:
		return
	pwmMotorRightForwards.ChangeDutyCycle(Stop)
	pwmMotorRightBackwards.ChangeDutyCycle(Stop)