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

Runs tasks sent by the taskUser file and keeps the touch panel measurement data updated. More...

Functions

def taskPanel.taskPanelFcn (taskName, period, pFlag, hFlag, Cart, Poxy, Voxy)
 Controls the touch panel as determined by the taskUser file. More...
 

Variables

 taskPanel.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskPanel.S1_UPDATE = micropython.const(1)
 Defines the State 1 Update variable as the constant 1.
 
 taskPanel.S2_SETCOEFF = micropython.const(2)
 Defines the State 2 Set Calibration Coefficients variable as the constant 2.
 
 taskPanel.S3_GETCOEFF = micropython.const(3)
 Defines the State 3 Get Calibration Coefficients variable as the constant 3.
 
 taskPanel.S4_POXY = micropython.const(4)
 Defines the State 4 X-Y Position variable as the constant 4.
 

Detailed Description

Runs tasks sent by the taskUser file and keeps the touch panel measurement data updated.

Acts as a background function file controlling the touch panel for the primary user interface so that the user interface does not have to perform touch panel updating directly. It will provide the x and y positions and velocities of whatever is touching the touch panel as a shared variable for use in other files, and it can calibrate the touch panel when told to by the user task. It will continuously update the touch panel every 10 milliseconds when run from main.


The State Transition Diagram for taskIMU can be seen here.


Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Term%20Project/taskPanel.py

Author
Lucas Murray
Max Cassady
Date
March 17, 2022

Function Documentation

◆ taskPanelFcn()

def taskPanel.taskPanelFcn (   taskName,
  period,
  pFlag,
  hFlag,
  Cart,
  Poxy,
  Voxy 
)

Controls the touch panel as determined by the taskUser file.

Interfaces with the taskUser file through the use of the shared flag and tuple parameters, keeping the touch panel updated and performing calibration when told to.

Parameters
taskNameThe name of the task a string
periodThe period of the task in microseconds as an integer
pFlagTuple variable shared between taskUser and taskPanel for the calibration and read commands
hFlagBoolean variable shared between taskPanel and taskMotor for the haptic feedback command
CartTuple shared between taskData and taskPanel that contains the touch panel position and velocity data values
PoxyTuple shared between taskMotor and taskPanel that stores the touch panel xy position values
VoxyTuple shared between taskMotor and taskPanel that stores the touch panel xy velocity values