![]() |
TouchScreenAdapter v0.5.0
TouchScreenAdapter is a library providing a unified touchscreen API.
|
Concrete implementation of TouchScreenAdapter for Adafruit's FT6206 TouchScreen class.
Although the FT6206 reports X and Y as pixel coordinates, both axis are reversed! (ie higher numbers are up or left) So setDisplayWidth() and setDisplayHeight() are required if they are not the default 240(W) and 320(H) in order to reverse X & Y.
#include <AdafruitFT6206TouchScreen.h>
Public Member Functions | |
AdafruitFT6206TouchScreen (uint8_t thresh=FT62XX_DEFAULT_THRESHOLD, TwoWire *theWire=&Wire, uint8_t i2c_addr=FT62XX_DEFAULT_ADDR) | |
Construct a new AdafruitFT6206TouchScreen Adapter. More... | |
bool | begin (void) |
begin() Calls the FT6106 begin() method. More... | |
TouchScreenAdapter::TouchPoint | getTouchPoint () |
Get the Touch Point object. More... | |
TouchScreenAdapter::TouchPoint | getTouchPointRaw () |
Get the raw TouchPoint struct containing X/Y values directly from the underlyig library. More... | |
![]() | |
void | setDisplayWidth (uint16_t widthPx) |
Set the native (non-rotated) display width (X) in pixels. More... | |
void | setDisplayHeight (uint16_t heightPx) |
Set the native (non-rotated) display height (Y) in pixels. More... | |
virtual TouchScreenAdapter::TouchPoint | getTouchPoint (void)=0 |
Get the TouchPoint object. More... | |
virtual TouchScreenAdapter::TouchPoint | getTouchPointRaw (void)=0 |
Get a TouchPoint struct containing raw values from the underlying library. More... | |
virtual bool | begin (void)=0 |
For compatibility with the Arduino library convention. More... | |
void | setRotation (uint8_t r) |
Set the rotation touch screen. More... | |
Additional Inherited Members | |
![]() | |
uint8_t | rotation = 0 |
The current rotation of the touch panel. Default is 0 (native orientation). | |
uint16_t | DISPLAY_WIDTH = 240 |
The non-rotated width of the display in pixels. | |
uint16_t | DISPLAY_HEIGHT = 320 |
The non-rotated height of the display in pixels. | |
uint16_t | displayWidth = DISPLAY_WIDTH |
The (optionally rotated) width of the display in pixels. | |
uint16_t | displayHeight = DISPLAY_HEIGHT |
The (optionally rotated) height of the display in pixels. | |
|
inline |
Construct a new AdafruitFT6206TouchScreen Adapter.
When using this constructor you must setDisplayWidth() and setDisplayHeight() if they are not the default 240(W) and 320(H)
thresh | The touch threshold, defaults to FT62XX_DEFAULT_THRESHOLD |
theWire | The required Wire library, defaults to the standard Wire. |
i2c_addr | The I2C address, defaults to FT62XX_DEFAULT_ADDR |
|
inlinevirtual |
begin() Calls the FT6106 begin()
method.
Implements TouchScreenAdapter.
|
inlinevirtual |
|
inlinevirtual |
Get the raw TouchPoint struct containing X/Y values directly from the underlyig library.
For the FT6206 this will result in the X and Y values being reversed! ie low values are botom/right and high values are top/left.
Implements TouchScreenAdapter.