ME 405 Portfolio
touchDriver.TouchPanel Class Reference

Tells where it is being touched. More...

Public Member Functions

def __init__ (self, xp, xm, yp, ym, p_len, p_width, center, res=0xfff, delay=3)
 Initialization Function. More...
 
def xScan (self)
 xScan method More...
 
def yScan (self)
 yScan method More...
 
def zScan (self)
 zScan method More...
 
def scan (self)
 scan coordinates More...
 
def filter (self)
 signal filtering for later implementation
 

Public Attributes

 xp
 High X pin. More...
 
 xm
 Low X pin. More...
 
 yp
 High Y pin. More...
 
 ym
 Low Y pin. More...
 
 p_len
 Length value. More...
 
 p_width
 Width value. More...
 
 ox
 Center X value. More...
 
 oy
 Center Y value. More...
 
 res
 Resolution. More...
 
 delay
 Delay time. More...
 
 hiPin
 High Voltage side. More...
 
 loPin
 Low Voltage side. More...
 
 vPin
 Reading Pin. More...
 
 fPin
 Floating Pin. More...
 

Detailed Description

Tells where it is being touched.

Input 4 pin values, the length of the touchscreen, the width of the touchscreen, the distance from x = 0 edge to the center, and the distance form the y = 0 edge to the center. Once given, the class will return results from whichever method activated. Also tells wether or not it is even being touched

Author
Hunter Morse
Date
Mar. 1, 2021

Constructor & Destructor Documentation

◆ __init__()

def touchDriver.TouchPanel.__init__ (   self,
  xp,
  xm,
  yp,
  ym,
  p_len,
  p_width,
  center,
  res = 0xfff,
  delay = 3 
)

Initialization Function.

Stores the parameters input by the user when creating the class object so that they may be used later by other functions.

Parameters
xppin registered to xp
xmpin registered to xm
yppin registered to yp
ympin registered to ym
p_lenpanel length
p_widthpanel width
centerox and oy coordinate tuple of panel origin (center)
resresolution of adc
delayread delay to ensure signal settled

Member Function Documentation

◆ scan()

def touchDriver.TouchPanel.scan (   self)

scan coordinates

Runs the x coordinate, y coordinate, and z boolean methods. It then returns those values in a tuple.

Parameters
None

◆ xScan()

def touchDriver.TouchPanel.xScan (   self)

xScan method

Reads the value of the Ym pin to determine the voltage being sent to it by contact with the Xp Xm line. This voltage is proportional to the distance along the x axis where the screen is being touched. That is converted from an analog ot a digital value between 0 and 4095. The value is then divided by 4095 and multiplied by the length of the screen to get the actual x placement of where the screen is being touched. X0 is then subtracted from that value to put the origin at the center of the screen lengthwise, with the negative being on the left and the positive being on the right.

Parameters
None

◆ yScan()

def touchDriver.TouchPanel.yScan (   self)

yScan method

Reads the value of the Xm pin to determine the voltage being sent to it by contact with the Yp Ym line. This voltage is proportional to the distance along the y axis where the screen is being touched. That is converted from an analog ot a digital value between 0 and 4095. The value is then divided by 4095 and multiplied by the width of the screen to get the actual x placement of where the screen is being touched. Y0 is then subtracted from that value to put the origin at the center of the screen widthwise, with the negative being on the bottom and the positive being on the top.

Parameters
None

◆ zScan()

def touchDriver.TouchPanel.zScan (   self)

zScan method

Reads the value of the Ym pin to determine the voltage being sent to it by contact with the Yp Xm line. When the screen is being touched, Ym will receive a lower amount of voltage as some of the voltage will go to Xm which is set to low. When the value being read by Ym decreases, Z boolean pin will be set to say that contact has been made.

Parameters
None

Member Data Documentation

◆ delay

touchDriver.TouchPanel.delay

Delay time.

delay to ensure system has settled

◆ fPin

touchDriver.TouchPanel.fPin

Floating Pin.

Create object that does nothing intentionally

◆ hiPin

touchDriver.TouchPanel.hiPin

High Voltage side.

Create object that will later be used to label the high voltage side of the resistance touchpad juncture

◆ loPin

touchDriver.TouchPanel.loPin

Low Voltage side.

Create object that will later be used to label the low voltage side of the resistance touchpad juncture

◆ ox

touchDriver.TouchPanel.ox

Center X value.

Stores the value of the X center of the screen that the user input

◆ oy

touchDriver.TouchPanel.oy

Center Y value.

Stores the value of the Y center of the screen that the user input

◆ p_len

touchDriver.TouchPanel.p_len

Length value.

Stores the value of the length of the screen that the user input

◆ p_width

touchDriver.TouchPanel.p_width

Width value.

Stores the value of the width of the screen that the user input

◆ res

touchDriver.TouchPanel.res

Resolution.

resolution of our adc

◆ vPin

touchDriver.TouchPanel.vPin

Reading Pin.

Create object to read voltage coming from juncture

◆ xm

touchDriver.TouchPanel.xm

Low X pin.

This pin is kept floating in order to read values from the high X

◆ xp

touchDriver.TouchPanel.xp

High X pin.

This pin is high to output a voltage that will go through the touchscreen

◆ ym

touchDriver.TouchPanel.ym

Low Y pin.

This pin is kept floating in order to read values from the high Y

◆ yp

touchDriver.TouchPanel.yp

High Y pin.

This pin is high to output a voltage that will go through the touchscreen


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