diff --git a/doc/api/pupdevices.rst b/doc/api/pupdevices.rst index 412db43..9706199 100644 --- a/doc/api/pupdevices.rst +++ b/doc/api/pupdevices.rst @@ -13,24 +13,12 @@ Motor Example:: - # Initialize a motor (by default this means is, without any gears). + # Initialize a motor. example_motor = Motor(Port.A) # Initialize a motor with positive speed as counterclockwise right_motor = Motor(Port.B, Direction.COUNTERCLOCKWISE) - # Initialize a motor with a gear train - robot_arm = Motor(Port.C, Direction.CLOCKWISE, [12, 36]) - - .. rubric:: Methods for motors without rotation sensors - - .. automethod:: pybricks.pupdevices.Motor.dc - - Example:: - - # Set the motor duty cycle to 75%. - example_motor.duty(75) - .. rubric:: Methods for motors with rotation sensors .. automethod:: pybricks.pupdevices.Motor.angle @@ -49,6 +37,17 @@ Motor .. automethod:: pybricks.pupdevices.Motor.run_target + .. rubric:: Methods for all motors + + .. automethod:: pybricks.pupdevices.Motor.dc + + Example:: + + # Set the motor duty cycle to 75%. + example_motor.duty(75) + + .. automethod:: pybricks.pupdevices.Motor.stop + Color and Distance Sensor ^^^^^^^^^^^^^^^^^^^^^^^^^