Adafruit TouchScreen
Public Member Functions | Public Attributes | List of all members
TouchScreen Class Reference

#include <TouchScreen.h>

Public Member Functions

 TouchScreen (uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx)
 Construct a new Touch Screen object. More...
 
bool isTouching (void)
 NOT IMPLEMENTED Test if the screen has been touched More...
 
uint16_t pressure (void)
 Read the touch event's Z/pressure value. More...
 
int readTouchY ()
 Read the touch event's Y value. More...
 
int readTouchX ()
 Read the touch event's X value. More...
 
TSPoint getPoint ()
 Measure the X, Y, and pressure and return a TSPoint with the measurements. More...
 

Public Attributes

int16_t pressureThreshhold
 Pressure threshold for isTouching
 

Detailed Description

Object that controls and keeps state for a touch screen.

Constructor & Destructor Documentation

◆ TouchScreen()

TouchScreen::TouchScreen ( uint8_t  xp,
uint8_t  yp,
uint8_t  xm,
uint8_t  ym,
uint16_t  rx = 0 
)

Construct a new Touch Screen object.

Parameters
xpX+ pin. Must be an analog pin
ypY+ pin. Must be an analog pin
xmX- pin. Can be a digital pin
ymY- pin. Can be a digital pin
rxThe resistance in ohms between X+ and X- to calibrate pressure sensing

Member Function Documentation

◆ isTouching()

bool TouchScreen::isTouching ( void  )

NOT IMPLEMENTED Test if the screen has been touched

Returns
true : touch detected false: no touch detected

◆ pressure()

uint16_t TouchScreen::pressure ( void  )

Read the touch event's Z/pressure value.

Returns
int the Z measurement

◆ readTouchY()

int TouchScreen::readTouchY ( void  )

Read the touch event's Y value.

Returns
int the Y measurement

◆ readTouchX()

int TouchScreen::readTouchX ( void  )

Read the touch event's X value.

Returns
int the X measurement

◆ getPoint()

TSPoint TouchScreen::getPoint ( void  )

Measure the X, Y, and pressure and return a TSPoint with the measurements.

Returns
TSPoint The measured X, Y, and Z/pressure values

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