Advertisement
zakka282

CercaPulsante

Nov 18th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //Pulsanti {pos x, pos y, larghezza, altezza}
  3.                 // ==== Pulsanti generici ===
  4. int Puls_BACK [4] = {0,220,55,20};
  5. int Puls_OK [4] = {265,220,55,20};
  6. void loop
  7. {
  8.     TSPoint p = ts.getPoint();
  9.     if (p.z > MINPRESSURE && p.z < MAXPRESSURE)
  10.     {
  11.       p.x = map(p.x, TS_MINY, TS_MAXY, 0, tft.height());
  12.       p.y = map(p.y, TS_MINX, TS_MAXX, 0, tft.width());
  13.       CercaPulsante(p.y,(tft.height() - p.x));
  14.     }
  15. }
  16.  
  17. void CercaPulsante
  18. {
  19.     if(((x>Puls_BACK[0]) && (x<Puls_BACK[0]+Puls_BACK[2])) && ((y>Puls_BACK[1]) && (y<Puls_BACK[1]+Puls_BACK[3])))
  20.         // Torna indietro
  21.     if(((x>Puls_OK[0]) && (x<Puls_OK[0]+Puls_OK[2])) && ((y>Puls_OK[1]) && (y<Puls_OK[1]+Puls_OK[3])))
  22.         // Conferma
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement