10 #include <TouchScreen.h> 13 #define YP A3 // must be an analog pin, use "An" notation! 14 #define XM A2 // must be an analog pin, use "An" notation! 15 #define YM 5 // can be a digital pin 16 #define XP 4 // can be a digital pin 24 #define MINPRESSURE 10 25 #define MAXPRESSURE 1000 44 #define REDBUTTON_X FRAME_X 45 #define REDBUTTON_Y FRAME_Y 46 #define REDBUTTON_W (FRAME_W/2) 47 #define REDBUTTON_H FRAME_H 49 #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W) 50 #define GREENBUTTON_Y FRAME_Y 51 #define GREENBUTTON_W (FRAME_W/2) 52 #define GREENBUTTON_H FRAME_H 106 int y = tft.
height() - p.x;
115 Serial.println(
"Red btn hit");
126 Serial.println(
"Green btn hit");
virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
int16_t height(void) const
void setCursor(int16_t x, int16_t y)
int16_t width(void) const
void setTextColor(uint16_t c)
void setRotation(uint8_t r)
void fillScreen(uint16_t color)
void setTextSize(uint8_t s)
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)