MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / set_motor_limits

Method set_motor_limits

Software/Python/gopigo3.py:493–505  ·  view source on GitHub ↗

Set the motor speed limit Keyword arguments: port -- The motor port(s). MOTOR_LEFT and/or MOTOR_RIGHT. power -- The power limit in percent (0 to 100), with 0 being no limit (100) dps -- The speed limit in degrees per second, with 0 being no limit

(self, port, power = 0, dps = 0)

Source from the content-addressed store, hash-verified

491 self.spi_transfer_array(outArray)
492
493 def set_motor_limits(self, port, power = 0, dps = 0):
494 """
495 Set the motor speed limit
496
497 Keyword arguments:
498 port -- The motor port(s). MOTOR_LEFT and/or MOTOR_RIGHT.
499 power -- The power limit in percent (0 to 100), with 0 being no limit (100)
500 dps -- The speed limit in degrees per second, with 0 being no limit
501 """
502 dps = int(dps * self.MOTOR_TICKS_PER_DEGREE)
503 outArray = [self.SPI_Address, self.SPI_MESSAGE_TYPE.SET_MOTOR_LIMITS, int(port), int(power),\
504 ((dps >> 8) & 0xFF), (dps & 0xFF)]
505 self.spi_transfer_array(outArray)
506
507 def get_motor_status(self, port):
508 """

Callers 4

reset_allMethod · 0.95
set_speedMethod · 0.45
orbitMethod · 0.45
TurnDegreesFunction · 0.45

Calls 1

spi_transfer_arrayMethod · 0.95

Tested by

no test coverage detected