ME 405 Romi
Loading...
Searching...
No Matches
motor_encoder_right_class.motor_encoder_right_class Class Reference

Right Motor Encoder Class. More...

Public Member Functions

 __init__ (self, motor, encoder, m_state_r, position_r, velocity_r, times, PWM_r, delay)
 Right Encoder Initialization.
 run (self)
 Runs the tasks for the Right Motor.

Public Attributes

 my_motor_Right = motor
 encoder_Right = encoder
 m_state_r = m_state_r
 position_r = position_r
 velocity_r = velocity_r
 times = times
 PWM_r = PWM_r
int delay_count = 0
int state = 0
 delay = delay

Detailed Description

Right Motor Encoder Class.

This task class which contains a generator finite state machine that runs multiple functions.

It drives the motor, reads the encoder and runs continuously, setting flags that are shared with other tasks.

Definition at line 10 of file motor_encoder_right_class.py.

Constructor & Destructor Documentation

◆ __init__()

motor_encoder_right_class.motor_encoder_right_class.__init__ ( self,
motor,
encoder,
m_state_r,
position_r,
velocity_r,
times,
PWM_r,
delay )

Right Encoder Initialization.

Parameters
1Motor Object
2Encoder Object
3Right Motor State in UI
4Right Encoder Position
5Right Motor Position
6Right Motor Velocity
7Times
8Right Motor PWM
9Delay

Definition at line 22 of file motor_encoder_right_class.py.

Member Function Documentation

◆ run()

motor_encoder_right_class.motor_encoder_right_class.run ( self)

Runs the tasks for the Right Motor.

State 0 Enable The Right Motor

State 1 Wait to get a different command from UI

State 2 Set Effort

State 3 Disable Motor

State 4 Enable Motor and Wait State

State 5 Stop the Motor and Zero the Encoder Ticks

Definition at line 48 of file motor_encoder_right_class.py.

Member Data Documentation

◆ delay

motor_encoder_right_class.motor_encoder_right_class.delay = delay

Definition at line 32 of file motor_encoder_right_class.py.

◆ delay_count

int motor_encoder_right_class.motor_encoder_right_class.delay_count = 0

Definition at line 30 of file motor_encoder_right_class.py.

◆ encoder_Right

motor_encoder_right_class.motor_encoder_right_class.encoder_Right = encoder

Definition at line 24 of file motor_encoder_right_class.py.

◆ m_state_r

motor_encoder_right_class.motor_encoder_right_class.m_state_r = m_state_r

Definition at line 25 of file motor_encoder_right_class.py.

◆ my_motor_Right

motor_encoder_right_class.motor_encoder_right_class.my_motor_Right = motor

Definition at line 23 of file motor_encoder_right_class.py.

◆ position_r

motor_encoder_right_class.motor_encoder_right_class.position_r = position_r

Definition at line 26 of file motor_encoder_right_class.py.

◆ PWM_r

motor_encoder_right_class.motor_encoder_right_class.PWM_r = PWM_r

Definition at line 29 of file motor_encoder_right_class.py.

◆ state

int motor_encoder_right_class.motor_encoder_right_class.state = 0

Definition at line 31 of file motor_encoder_right_class.py.

◆ times

motor_encoder_right_class.motor_encoder_right_class.times = times

Definition at line 28 of file motor_encoder_right_class.py.

◆ velocity_r

motor_encoder_right_class.motor_encoder_right_class.velocity_r = velocity_r

Definition at line 27 of file motor_encoder_right_class.py.


The documentation for this class was generated from the following file: