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:
By default, the positive direction is set as clockwise. Refer to this diagram to see which direction this is for EV3 motors.
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)