|
ME 305
|
Handles the user UI of our encoder system. More...
Functions | |
| def | task_user.taskUser (taskname, period, zFlag, pFlag, dFlag, gFlag, mFlag, MFlag, position, delta, P, T, duty, Dtime, eFlag) |
| A generator to implement the UI task as an Finite State Machine. More... | |
Variables | |
| task_user.S7_MOTOR1 = micropython.const(7) | |
| State 7 - Motor 1 Activated. More... | |
| task_user.S8_MOTOR2 = micropython.const(8) | |
| State 8 - Motor 2 Activated. | |
| task_user.S9_VELOCITY = micropython.const(9) | |
| State 9 - Find Velocity. More... | |
| task_user.S10_ENABLE = micropython.const(10) | |
| State 10 - Enables motors | |
| task_user.S11_TEST = micropython.const(11) | |
| State 11 - Start testing interface. More... | |
Handles the user UI of our encoder system.
This file interacts directly with user keyboard inputs to then send the request to the task_encoder.py file. It uses six states that correspond to different key in puts to send the program into its appropriate settings based on the user input.
| def task_user.taskUser | ( | taskname, | |
| period, | |||
| zFlag, | |||
| pFlag, | |||
| dFlag, | |||
| gFlag, | |||
| mFlag, | |||
| MFlag, | |||
| position, | |||
| delta, | |||
| P, | |||
| T, | |||
| duty, | |||
| Dtime, | |||
| eFlag | |||
| ) |
A generator to implement the UI task as an Finite State Machine.
The task runs as a generator function and requires a task name and interval to be specified. This task file receives flag values altered by the user. These flags are then shared with task_encoder.py where that task file can execute actions defined in encoder.py. Once the desired task is completed, the state is reset back to idle state (State 1).
| taskName | The name of the task as a string. |
| period | Specifies how long the task has to perform its function in microseconds. Specified as an integer. |
| zFlag | Holds True or False value to know when zeroing command was called by the user to zero the current position of the encoder. |
| pFlag | Holds True or False value to know when position command was called by the user to know the current position of the encoder. |
| dFlag | Holds True or False value to know when delta command was called by the user to know the current delta (speed) of the encoder. |
| gFlag | Holds True or False value to know when data collection command was called by the user to collect current time and position data. |
| position | Stores current position of encoder to be read in task_user.py |
| delta | Stores the delta (speed) of the encoder to be read in to task_user.py |
| P | Stores current position of encoder for data collection |
| T | Stores current time of encoder for data collection |
| task_user.S11_TEST = micropython.const(11) |
State 11 - Start testing interface.
State for testing interface for users to input duty and velocity
| task_user.S7_MOTOR1 = micropython.const(7) |
State 7 - Motor 1 Activated.
State that allows user to input duty cycle for motor 1
| task_user.S9_VELOCITY = micropython.const(9) |
State 9 - Find Velocity.
Calculates the velocity of motor 1