Returns the name of the port that this motor is connected to.
Sets the command for the motor. Possible values are run-forever
, run-timed
and
stop
. Not all commands may be supported, so be sure to check the contents
of the commands
attribute.
Returns a list of commands supported by the motor controller.
Returns the name of the motor driver that loaded this device. See the list of [supported devices] for a list of drivers.
Shows the current duty cycle of the PWM signal sent to the motor. Values are -100 to 100 (-100% to 100%).
Writing sets the duty cycle setpoint of the PWM signal sent to the motor. Valid values are -100 to 100 (-100% to 100%). Reading returns the current setpoint.
Writing sets the duty cycle setpoint of the PWM signal sent to the motor. Valid values are -100 to 100 (-100% to 100%). Reading returns the current setpoint.
Sets the polarity of the motor. Valid values are normal
and inversed
.
Sets the polarity of the motor. Valid values are normal
and inversed
.
Sets the time in milliseconds that it take the motor to ramp down from 100% to 0%. Valid values are 0 to 10000 (10 seconds). Default is 0.
Sets the time in milliseconds that it take the motor to ramp down from 100% to 0%. Valid values are 0 to 10000 (10 seconds). Default is 0.
Sets the time in milliseconds that it take the motor to up ramp from 0% to 100%. Valid values are 0 to 10000 (10 seconds). Default is 0.
Sets the time in milliseconds that it take the motor to up ramp from 0% to 100%. Valid values are 0 to 10000 (10 seconds). Default is 0.
Gets a list of flags indicating the motor status. Possible
flags are running
and ramping
. running
indicates that the motor is
powered. ramping
indicates that the motor has not yet reached the
duty_cycle_sp
.
Sets the stop action that will be used when the motor stops. Read
stop_actions
to get the list of valid values.
Gets a list of stop actions. Valid values are coast
and brake
.
Writing specifies the amount of time the motor will run when using the
run-timed
command. Reading returns the current value. Units are in
milliseconds.
Writing specifies the amount of time the motor will run when using the
run-timed
command. Reading returns the current value. Units are in
milliseconds.
Generated using TypeDoc
The DC motor class provides a uniform interface for using regular DC motors with no fancy controls or feedback. This includes LEGO MINDSTORMS RCX motors and LEGO Power Functions motors.