Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long first = 0;
- long second = 0;
- int zoneSelected = 0;
- int times = 0;
- if (y > 510 && x > 520 && x < 800 && y <800)
- {
- zoneSelected = 1;
- first = millis();
- }
- else
- if (y>510 && x < 510)
- {
- zoneSelected = 2;
- }
- else
- if (y<500 && x>520)
- {
- zoneSelected = 3;
- }
- else
- if (y<500 && x<510)
- {
- zoneSelected = 4;
- }
- else
- if (x>800 && y>800)
- {
- //this will be called each time a finger is lifted
- second = millis();
- if(second - first < 300) {
- //possible double tap
- times++;
- second = millis();
- first = second;
- } else {
- times = 0;
- second = millis();
- first = second;
- }
- if(times%2 == 0) {Serial.println(String(zoneSelected)); times = 0; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement