stepper_motor_base
frog.hardware.plugins.stepper_motor.stepper_motor_base
¤
Provides the base class for stepper motor implementations.
Attributes¤
Classes¤
StepperMotorBase()
¤
Bases: Device
A base class for stepper motor implementations.
Create a new StepperMotorBase.
Subscribe to stepper motor pubsub messages.
Source code in frog/hardware/plugins/stepper_motor/stepper_motor_base.py
12 13 14 15 16 17 18 19 20 |
|
Attributes¤
angle
property
¤
The current angle of the motor in degrees.
Returns:
Type | Description |
---|---|
float
|
The current angle |
is_moving
abstractmethod
property
¤
Whether the motor is currently moving.
step
abstractmethod
property
writable
¤
The current state of the device's step counter.
steps_per_rotation
abstractmethod
property
¤
The number of steps that correspond to a full rotation.
Functions¤
move_to(target)
¤
Move the motor to a specified rotation and send message when complete.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
float | str
|
The target angle (in degrees) or the name of a preset |
required |
Source code in frog/hardware/plugins/stepper_motor/stepper_motor_base.py
74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
preset_angle(name)
staticmethod
¤
Get the angle for one of the preset positions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of preset angle |
required |
Returns:
Type | Description |
---|---|
float
|
The angle in degrees |
Source code in frog/hardware/plugins/stepper_motor/stepper_motor_base.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
send_move_end_message()
¤
Send a message containing the angle moved to, once move ends.
Source code in frog/hardware/plugins/stepper_motor/stepper_motor_base.py
88 89 90 |
|
stop_moving()
abstractmethod
¤
Immediately stop moving the motor.
Source code in frog/hardware/plugins/stepper_motor/stepper_motor_base.py
56 57 58 |
|