ME 305
|
Directly interfaces with encoder. More...
Functions | |
def | task_encoder.taskEncoder (taskname, period, zFlag, pFlag, dFlag, gFlag, position, delta, P, T, Dtime) |
Generator function to inteface with encoder. More... | |
Directly interfaces with encoder.
Called at a frequency of 100Hz, this task file uses the class Encoder within the encoder.py drive file to interface with the encoder. Continually updating the position of the encoder, this task file uses flag values altered by the user in task_user.py to execute actions defined in encoder.py. Once the action is completed, these flags are reset.
def task_encoder.taskEncoder | ( | taskname, | |
period, | |||
zFlag, | |||
pFlag, | |||
dFlag, | |||
gFlag, | |||
position, | |||
delta, | |||
P, | |||
T, | |||
Dtime | |||
) |
Generator function to inteface with encoder.
Generator function receives values of certain flags that correspond to a desired action from the user. This then triggers the function to interact with the encoder.py drive file, performing the necessary action or storing the value for the user to then see with their interface.
taskname | Name of the task being performed. |
period | Specifies how long the task has to perform its function. received as 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 transferred to task_user.py |
delta | Stores the delta (speed) of the encoder to be transferred to task_user.py |
P | Stores current position of encoder for data collection |
T | Stores current time of encoder for data collection |
Dtime | Contains value for the change in time between updates |