mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
doc/pupdevices: drop gears example
This is reserved for the detailed Motor page.
This commit is contained in:
+12
-13
@@ -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
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user