Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
|
A method for instantiating, updating the position, and zeroing a quadrature encoder object. More...
Functions | |
def | Lab0x04_taskEncoder.taskEncoderFcn (taskName, period, zFlag, timDATA, posDATA, delDATA, DATA, speedDATA) |
A generator to implement the Encoder task as an FSM. More... | |
Variables | |
Lab0x04_taskEncoder.S0_INIT = micropython.const(0) | |
Lab0x04_taskEncoder.S1_Update = micropython.const(1) | |
Lab0x04_taskEncoder.S2_Zero = micropython.const(2) | |
A method for instantiating, updating the position, and zeroing a quadrature encoder object.
This file calls the encoder.py class to generate an encoder object. It is then called from an external file to perform updates to the position of that encoder object, and to zero/reset the absolute position of that encoder object. The external file utilizes other tasks in addition; therefore, this file is set up to work within a cooperative multitasking context. In particular, this file works with taskUser.py.
def Lab0x04_taskEncoder.taskEncoderFcn | ( | taskName, | |
period, | |||
zFlag, | |||
timDATA, | |||
posDATA, | |||
delDATA, | |||
DATA, | |||
speedDATA | |||
) |
A generator to implement the Encoder task as an FSM.
The task runs as a generator function and requires a task name and interval to be specified.
taskName | The name of the task as a string. |
period | The task interval or period specified as an integer number of microseconds. |
zFlag | Shared flag variable which causes FSM to enter zeroing state. |
timDATA | Shared data for the time during a data recording session. This is not currently utilized by taskUser.py (instead, it is immediately fed into DATA); however, this is shared to taskUser for debugging purposes. |
posDATA | Shared data for printing the position of the encoder upon 'p' or 'P' press. |
delDATA | Shared data for printing the delta value of the encoder upon 'd' or 'D' press. |
DATA | Shared data for data recording upon 'g' or 'G' press. |