ME 305 Group 6 Documentation
Functions | Variables
taskPanel.py File Reference

Task for creating, calibrating, and operating the touch panel object. More...

Functions

def taskPanel.taskPanelFcn (str taskName, int period, shares.Share x_position_signal, shares.Share y_position_signal, shares.Share ball_detected, shares.Share panelCalStatus, PrintQueue print_queue, shares.Share touch_calib_status, shares.Share imu_calib_status, shares.Share x_pos_deriv_signal, shares.Share y_pos_deriv_signal)
 Continuously reads touch panel position. More...
 

Variables

 taskPanel.S0_READ = micropython.const(0)
 State 0. More...
 
 taskPanel.S1_CALIB = micropython.const(1)
 State 1. More...
 

Detailed Description

Task for creating, calibrating, and operating the touch panel object.

If no calibration file exists, this task first runs the calibration method. The coefficients are then stored in a text file on the pyBoard for later use. If the file already exists, the task skips the calibration process and uses the values from the existing file. This progression can be seen in the state diagram below.

Lab 5 State Diagram

Author
Caleb Savard
Chris Linthacum
Date
March 17, 2022

Function Documentation

◆ taskPanelFcn()

def taskPanel.taskPanelFcn ( str  taskName,
int  period,
shares.Share  x_position_signal,
shares.Share  y_position_signal,
shares.Share  ball_detected,
shares.Share  panelCalStatus,
PrintQueue  print_queue,
shares.Share  touch_calib_status,
shares.Share  imu_calib_status,
shares.Share  x_pos_deriv_signal,
shares.Share  y_pos_deriv_signal 
)

Continuously reads touch panel position.

Each run, updates shared variables with touch panel ball position

Parameters
taskNameTask name label for debugging purposes
periodPeriod to run taskPanelFcn
x_position_signalShared variable to store x position of the ball
y_position_signalShared variable to story y position of the ball
ball_detectedShared variable to store boolean of whether or not the ball is detected
panelCalStatusShared variable to store whether or not the panel is calibrated.
print_queuePrint Queue object for passing print messages to the taskUser.
touch_calib_statusShared variable for whether the touch calibration status is true or false.
imu_calib_statusShared variable for whether or not the IMU has been calibrated. (Will not attempt to calibrate touch panel until IMU is complete.)
x_pos_deriv_signalShared variable to store x position derivative
y_pos_deriv_signalShared variable to store y position derivative

Variable Documentation

◆ S0_READ

taskPanel.S0_READ = micropython.const(0)

State 0.

Const() value for the read state

◆ S1_CALIB

taskPanel.S1_CALIB = micropython.const(1)

State 1.

Cosnt() value for the calibration state