Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Pulsanti {pos x, pos y, larghezza, altezza}
- // ==== Pulsanti generici ===
- int Puls_BACK [4] = {0,220,55,20};
- int Puls_OK [4] = {265,220,55,20};
- void loop
- {
- TSPoint p = ts.getPoint();
- if (p.z > MINPRESSURE && p.z < MAXPRESSURE)
- {
- p.x = map(p.x, TS_MINY, TS_MAXY, 0, tft.height());
- p.y = map(p.y, TS_MINX, TS_MAXX, 0, tft.width());
- CercaPulsante(p.y,(tft.height() - p.x));
- }
- }
- void CercaPulsante
- {
- if(((x>Puls_BACK[0]) && (x<Puls_BACK[0]+Puls_BACK[2])) && ((y>Puls_BACK[1]) && (y<Puls_BACK[1]+Puls_BACK[3])))
- // Torna indietro
- if(((x>Puls_OK[0]) && (x<Puls_OK[0]+Puls_OK[2])) && ((y>Puls_OK[1]) && (y<Puls_OK[1]+Puls_OK[3])))
- // Conferma
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement