ME405: Mechatronics
Project Documentation and Portfolio by Neil Patel
touchPanel.TouchDriver Class Reference

A driver to allow for interaction with Resistive touch panel. More...

Public Member Functions

def __init__ (self, ym=pyb.Pin.board.PA0, xm=pyb.Pin.board.PA1, yp=pyb.Pin.board.PA6, xp=pyb.Pin.board.PA7)
 Initializes the TouchPanel object with the correct pins and measurements. More...
 
def scan_X (self)
 Scans the touch panel for the X value of the touch in mm relative to the center. More...
 
def scan_Y (self)
 Scans the touch panel for the Y value of the touch in mm relative to the center. More...
 
def scan_Z (self)
 Scans the touch panel to check if it detects anything. More...
 
def scan_ALL (self)
 Scans the touch panel for all measurements. More...
 

Public Attributes

 ym
 
 xm
 
 yp
 
 xp
 
 length
 
 width
 

Detailed Description

A driver to allow for interaction with Resistive touch panel.

This class defines methods to interact with a touch panel - measuring the X and Y position of a touch, as well as determining if anything is touching the panel.

Constructor & Destructor Documentation

◆ __init__()

def touchPanel.TouchDriver.__init__ (   self,
  ym = pyb.Pin.board.PA0,
  xm = pyb.Pin.board.PA1,
  yp = pyb.Pin.board.PA6,
  xp = pyb.Pin.board.PA7 
)

Initializes the TouchPanel object with the correct pins and measurements.

Parameters
ymthe pyb.pin for the minus y (y-) wire from the panel (default: pyb.Pin.board.PA0)
xmthe pyb.pin for the minus x (x-) wire from the panel (default: pyb.Pin.board.PA1)
ypthe pyb.pin for the plus y (y+) wire from the panel (default: pyb.Pin.board.PA6)
xpthe pyb.pin for the plus x (x+) wire from the panel (default: pyb.Pin.board.PA7)
Returns
Returns nothing.

Member Function Documentation

◆ scan_ALL()

def touchPanel.TouchDriver.scan_ALL (   self)

Scans the touch panel for all measurements.

Returns
(Z,X,Y) Triple containing the x, y, and z values

◆ scan_X()

def touchPanel.TouchDriver.scan_X (   self)

Scans the touch panel for the X value of the touch in mm relative to the center.

Returns
x value in mm

◆ scan_Y()

def touchPanel.TouchDriver.scan_Y (   self)

Scans the touch panel for the Y value of the touch in mm relative to the center.

Returns
y value in mm

◆ scan_Z()

def touchPanel.TouchDriver.scan_Z (   self)

Scans the touch panel to check if it detects anything.

Returns
boolean, True if object is detected

The documentation for this class was generated from the following file: