Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
Functions | Variables
taskPanel.py File Reference

Implementation of four wire resistive touchpanel unit calibration and data reading as a finite state machine. More...

Functions

def taskPanel.taskPanelFcn (taskName, period, faultFlag, cFlag, DATA)
 A generator to implement the touchpanel operation as an FSM. More...
 

Variables

 taskPanel.S0_INIT = micropython.const(0)
 S0_INIT is the initialization state of the taskPanel.py FSM. More...
 
 taskPanel.S1_RUN = micropython.const(1)
 S1_RUN is the data reading/object updating state of the taskPanel.py FSM. More...
 
 taskPanel.S2_CAL = micropython.const(2)
 S2_CAL is the calibration state of the taskPanel.py FSM. More...
 

Detailed Description

Implementation of four wire resistive touchpanel unit calibration and data reading as a finite state machine.

This file calls the touchpanel.touchpanel class to generate an resistive touchpanel object. This file is called iteratively from the main.py program management file to calibrate and read position data from the touchpanel.

Author
Logan Williamson
Brianna Roberts
Date
03/08/2022

Function Documentation

◆ taskPanelFcn()

def taskPanel.taskPanelFcn (   taskName,
  period,
  faultFlag,
  cFlag,
  DATA 
)

A generator to implement the touchpanel operation as an FSM.

The task runs as a generator function and requires a task name and interval to be specified.

Parameters
taskNameThe name of the task as a string.
periodThe task interval or period specified as an integer number of microseconds.
cFlagLocal flag variable used to check if calibration coefficient file exists.
DATAShared data for data recording upon 'g' or 'G' press.

Variable Documentation

◆ S0_INIT

taskPanel.S0_INIT = micropython.const(0)

S0_INIT is the initialization state of the taskPanel.py FSM.

S0_INIT is used to initialize the FSM. Simply transitions from S0 to S1.

◆ S1_RUN

taskPanel.S1_RUN = micropython.const(1)

S1_RUN is the data reading/object updating state of the taskPanel.py FSM.

S1_RUN is the running state for the taskPanel.py finite state machine. This state is where the touchpanel object(s) managed by taskPanel.py is/are updated with data read from the physical touchpanel.

◆ S2_CAL

taskPanel.S2_CAL = micropython.const(2)

S2_CAL is the calibration state of the taskPanel.py FSM.

S2_CAL is the calibration state for the taskPanel.py finite state machine. This state is where the touchpanel object(s) managed by taskPanel.py is/are calibrated upon startup to ensure the data being read from the panel is an accurate reflection of the physical panel surface coordinate system.