motor_task¶
- class motor_task.MotorTask(right_motor_pins, left_motor_pins, right_channel, left_channel, r_gains, l_gains)¶
Bases:
object
A class to control motor speed and movement using PID control.
- STOP¶
State representing a stopped motor (1).
- Type:
int
- MOVE¶
State representing a moving motor (2).
- Type:
int
- state¶
Current state of the motor task (STOP or MOVE).
- Type:
int
- current_speed¶
Current speed setting for the motors.
- Type:
int
- go(shares)¶
Controls motor speed and direction based on shared queue values.
- Parameters:
shares (list) – A tuple containing queues for right/left motor speed, stopping states, and velocity feedback.
- Yields:
state (int) – The value of the current state within the machine