parameters – Parameters and Constants¶
Constant parameters/arguments for the Pybricks API.
Port on the programmable brick or hub.
Rotational direction for positive speed or angle values.
A positive speed value should make the motor move clockwise.
A positive speed value should make the motor move counterclockwise.
Positive speed: Negative speed:
In general, clockwise is defined by looking at the motor shaft, just like looking at a clock.
Some motors have two shafts. If in doubt, refer to the following diagrams:
Action after the motor stops: coast, brake, or hold.
Let the motor move freely.
Passively resist small external forces.
Keep controlling the motor to hold it at the commanded angle. This is only available on motors with encoders.
The following table show how each stop type adds an extra level of resistance to motion. In these examples,
DriveBase. The examples also show how running at zero speed compares to these stop types.TypeFrictionBackEMFSpeedkept at 0Angle keptat targetExamples
m.run_target(500, 90, Stop.COAST)
m.run_target(500, 90, Stop.BRAKE)
m.run_target(500, 90, Stop.HOLD)