File tree Expand file tree Collapse file tree 3 files changed +77
-60
lines changed Expand file tree Collapse file tree 3 files changed +77
-60
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /*
2+ Touch_IRQ
3+
4+ created 03 May 2023
5+ by Leonardo Cavagnis
6+ */
7+
8+ #include " Arduino_GigaDisplayTouch.h"
9+
10+ Arduino_GigaDisplayTouch touch;
11+
12+ void gigaTouchHandler (uint8_t contacts, GDTpoint_t* points) {
13+ Serial.print (" Contacts: " );
14+ Serial.println (contacts);
15+
16+ for (uint8_t i = 0 ; i < contacts; i++) {
17+ Serial.print (points[i].x );
18+ Serial.print (" " );
19+ Serial.println (points[i].y );
20+ }
21+ }
22+
23+ void setup () {
24+ Serial.begin (115200 );
25+ while (!Serial) {}
26+
27+ if (touch.begin ()) {
28+ Serial.println (" Touch controller init - OK" );
29+ } else {
30+ Serial.println (" Touch controller init - FAILED" );
31+ while (1 ) ;
32+ }
33+
34+ touch.attach (gigaTouchHandler);
35+ }
36+
37+ void loop () { }
Original file line number Diff line number Diff line change 1+ /*
2+ Touch_Polling
3+
4+ created 03 May 2023
5+ by Leonardo Cavagnis
6+ */
7+
8+ #include " Arduino_GigaDisplayTouch.h"
9+
10+ Arduino_GigaDisplayTouch touch;
11+
12+ void setup () {
13+ Serial.begin (115200 );
14+ while (!Serial) {}
15+
16+ if (touch.begin ()) {
17+ Serial.print (" Touch controller init - OK" );
18+ } else {
19+ Serial.print (" Touch controller init - FAILED" );
20+ while (1 ) ;
21+ }
22+ }
23+
24+ void loop () {
25+ uint8_t contacts;
26+ GDTpoint_t points[5 ];
27+
28+ if (touch.detect (contacts, points)) {
29+ Serial.print (" Contacts: " );
30+ Serial.println (contacts);
31+
32+ for (uint8_t i = 0 ; i < contacts; i++) {
33+ Serial.print (points[i].x );
34+ Serial.print (" " );
35+ Serial.println (points[i].y );
36+ }
37+ }
38+
39+ delay (1 );
40+ }
You can’t perform that action at this time.
0 commit comments