Lucas Murray ME 305 Portfolio
Functions | Variables
taskEncoder.py File Reference

Runs tasks sent by the taskUser file and keeps the encoder updated. More...

Functions

def taskEncoder.taskEncoderFcn (taskName, period, zFlag, data, delta)
 Performs the tasks as determined by the taskUser file. More...
 

Variables

 taskEncoder.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskEncoder.S1_UPDATE = micropython.const(1)
 Defines the State 1 Update variable as the constant 1.
 
 taskEncoder.S2_ZERO = micropython.const(2)
 Defines the State 2 Zero variable as the constant 2.
 

Detailed Description

Runs tasks sent by the taskUser file and keeps the encoder updated.

Acts as a background function file controlling the encoder for the primary user interface so that the user interface does not have to perform tasks directly. It will continuously update the encoder every 10 milliseconds.

/n The State Transition Diagram for taskEncoder can be seen here.

/n Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Lab%200x02/taskEncoder.py

Author
Lucas Murray
Max Cassady
Date
February 16, 2022

Function Documentation

◆ taskEncoderFcn()

def taskEncoder.taskEncoderFcn (   taskName,
  period,
  zFlag,
  data,
  delta 
)

Performs the tasks as determined by the taskUser file.

Interfaces with the taskUser file through the use of the shared flag parameters, keeping the encoder updated and performing the input commands

Parameters
taskNameThe name of the task a string
periodThe period of the task in microseconds as an integer
zFlagBoolean variable shared between taskUser and taskEncoder for the zero command
dataTuple data shared between taskUser and taskEncoder for data collection
deltaTuple shared between taskUser and taskEncoder that stores delta data