ME 305 Group 6 Documentation
|
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... | |
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.
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
taskName | Task name label for debugging purposes |
period | Period to run taskPanelFcn |
x_position_signal | Shared variable to store x position of the ball |
y_position_signal | Shared variable to story y position of the ball |
ball_detected | Shared variable to store boolean of whether or not the ball is detected |
panelCalStatus | Shared variable to store whether or not the panel is calibrated. |
print_queue | Print Queue object for passing print messages to the taskUser. |
touch_calib_status | Shared variable for whether the touch calibration status is true or false. |
imu_calib_status | Shared variable for whether or not the IMU has been calibrated. (Will not attempt to calibrate touch panel until IMU is complete.) |
x_pos_deriv_signal | Shared variable to store x position derivative |
y_pos_deriv_signal | Shared variable to store y position derivative |
taskPanel.S0_READ = micropython.const(0) |
State 0.
Const() value for the read state
taskPanel.S1_CALIB = micropython.const(1) |
State 1.
Cosnt() value for the calibration state