Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
|
A resistive touchpanel class. More...
Public Member Functions | |
def | __init__ (self) |
Initializes and returns an object associated with a resistive touch panel. More... | |
def | pos_update (self) |
Updates positional data of touchpanel. More... | |
def | scan_x (self) |
Individually scans the x position. More... | |
def | scan_y (self) |
Individually scans the y position. More... | |
def | scan_z (self) |
Individually scans the z position. More... | |
Public Attributes | |
z_pos | |
create object z_pos for the z position for touchpanel More... | |
timer | |
creates a timer object tim using the Timer method More... | |
x_p | |
creates a pin object x_p set to More... | |
x_m | |
creates a pin object x_m set to More... | |
y_p | |
creates a pin object y_p set to More... | |
y_m | |
creates an ADC object y_m acting on a pin More... | |
x_buf | |
creates an array object x_buf More... | |
y_buf | |
creates an array object y_buf More... | |
z_buf | |
creates an array object z_buf More... | |
position | |
creates a position object list of positions More... | |
Static Public Attributes | |
x_pos | |
create object x_pos for the x position for touchpanel More... | |
y_pos | |
create object y_pos for the y position for touchpanel More... | |
A resistive touchpanel class.
Objects of this class can be used to iteratively read the x- and y-locations of applied pressure on a four wire resistive touchpanel. Additionally, detects whether or not there is no pressure input on the panel ('z-location')
def touchpanel.touchpanel.__init__ | ( | self | ) |
Initializes and returns an object associated with a resistive touch panel.
Upon initialization, sets all base objects to 0 and or respective pins.The objects of this class are instantiated at 0 and then overwritten when the different methods are called.
def touchpanel.touchpanel.pos_update | ( | self | ) |
Updates positional data of touchpanel.
Upon calling the pos_update() method, scans x, y, and z positions by sets and resets the pins to OUT_PP and IN for measuring.
def touchpanel.touchpanel.scan_x | ( | self | ) |
Individually scans the x position.
Upon calling the scan_x() method, the x position can be individually scanned. This is already implemented in the pos_update method to run more efficiently, but for comprehension, this method was also included.
def touchpanel.touchpanel.scan_y | ( | self | ) |
Individually scans the y position.
Upon calling the scan_y() method, the y position can be individually scanned. This is already implemented in the pos_update method to run more efficiently, but for comprehension, this method was also included.
def touchpanel.touchpanel.scan_z | ( | self | ) |
Individually scans the z position.
Upon calling the scan_z() method, the z position can be individually scanned. This is already implemented in the pos_update method to run more efficiently, but for comprehension, this method was also included.
touchpanel.touchpanel.position |
creates a position object list of positions
position list in the order of x position, y position, and z position.
touchpanel.touchpanel.timer |
creates a timer object tim using the Timer method
Timer object PWM_tim passed in by user for the timer at a preset frequency of 100_000
touchpanel.touchpanel.x_buf |
creates an array object x_buf
x_buf is an array of length 25 populated with 0's
touchpanel.touchpanel.x_m |
creates a pin object x_m set to
pin used to connect pin A1 configured for output with OUT_PP
touchpanel.touchpanel.x_p |
creates a pin object x_p set to
pin used to connect pin A7 configured for output with OUT_PP
|
static |
create object x_pos for the x position for touchpanel
the x object is initially set to 0 but then changed to the updated values of the registered x position when different methods are run.
touchpanel.touchpanel.y_buf |
creates an array object y_buf
y_buf is an array of length x_buf populated with 0's
touchpanel.touchpanel.y_m |
creates an ADC object y_m acting on a pin
pin used to connect pin A0
touchpanel.touchpanel.y_p |
creates a pin object y_p set to
pin used to connect pin A6 configured for output with IN
|
static |
create object y_pos for the y position for touchpanel
the y object is initially set to 0 but then changed to the updated values of the registered y position when different methods are run.
touchpanel.touchpanel.z_buf |
creates an array object z_buf
z_buf is an array of length x_buf populated with 0's
touchpanel.touchpanel.z_pos |
create object z_pos for the z position for touchpanel
the z direction for the touchpanel is used to indicate if there is contact with the board. When z_pos = 0, contact with the board is not registered. When z_pos = 1, contact with the board is registered