Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <UTFT.h>
- #include <URTouch.h>
- UTFT myGLCD(ILI9481, 38, 39, 40, 41);
- URTouch myTouch(53, 52, 50, 51, 44);
- // Declare which fonts we will be using
- extern uint8_t BigFont[];
- int color = 0;
- word colorlist[] = {VGA_WHITE, VGA_BLACK};
- int bsize = 4;
- void setup()
- {
- myGLCD.InitLCD();
- myGLCD.clrScr();
- myGLCD.setFont(BigFont);
- myTouch.InitTouch();
- myTouch.setPrecision(PREC_HI);
- myGLCD.fillScr(VGA_BLACK);
- myGLCD.setColor(VGA_WHITE);
- myGLCD.print("X=", 0, 0);
- myGLCD.print("Y=", 0, 16);
- }
- void loop()
- {
- if (myTouch.dataAvailable())
- {
- myTouch.calibrateRead();
- myGLCD.print(String(myTouch.TP_X), 32, 0);
- myGLCD.print(String(myTouch.TP_Y), 32, 16);
- }
- else {
- myGLCD.print("no touch", 32, 0);
- myGLCD.print("no touch", 32, 16);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement