_api.motor – motor functions API¶
This module contains the API functions for user interaction with a motor brick.
This module is imported by the mindstorms – Mindstorms branding of the user API and spike – Spike Prime branding of the user API modules so that the API can be branded appropriately in documentation (i.e. so that Mindstorms docs can tell you to import mindstorms, and Spike Prime docs can tell you to import spike).
Motor Class¶
- class _api.motor.Motor(???)¶
???
Methods
- set_degrees_counted(???)¶
???
- set_default_speed(???)¶
???
- set_stop_action(???)¶
???
- set_stall_detection(???)¶
???
- get_position(???)¶
???
- get_speed(???)¶
???
- get_degrees_counted(???)¶
???
- get_default_speed(???)¶
???
- run_to_degrees_counted(???)¶
???
- run_to_position(???)¶
???
- run_for_degrees(???)¶
???
- run_for_rotations(???)¶
???
- run_for_seconds(???)¶
???
- was_stalled(???)¶
???
- was_interrupted(???)¶
???
- start_at_power(???)¶
???
- start(???)¶
???
- stop(???)¶
???
Constants
- BRAKE = brake¶
???
- HOLD = hold¶
???
- COAST = coast¶
???
Imports¶
Function
_api.util.newSensorDisconnectedErrorFunction
_api.util.wait_for_asyncFunction
utime.sleep_msFunction
util.motor.clamp_powerFunction
util.motor.clamp_speedFunction
util.sensors.is_typeConstant
system.system= <Main System object>Constant `util.constants.MOTOR_TYPES = (65, 48, 49, 75, 76)
Constant
util.constants.PORTS= {‘C’: Port(C), ‘B’: Port(B), ‘D’: Port(D), ‘E’: Port(E), ‘A’: Port(A), ‘F’: Port(F)}