Skip to content

Format library. #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions examples/Touch_IRQ/Touch_IRQ.ino
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
/*
/*
* Touch_IRQ.ino
*
* This example shows how to get the number of points and the coordinates of the first touch points detected by the touch controller using interrupts.
*
* The setup() function initializes the serial communication and the touch controller. Whenever a touch event is detcted, the gigaTouchHandler function is called that prints the number of points and first touch co-ordinates to the Serial Monitor. The loop() function is empty because the touch controller is configured to work with interrupts.
*
*
* This example shows how to get the number of points and the coordinates of the
* first touch points detected by the touch controller using interrupts.
*
* The setup() function initializes the serial communication and the touch
* controller. Whenever a touch event is detcted, the gigaTouchHandler function
* is called that prints the number of points and first touch co-ordinates to
* the Serial Monitor. The loop() function is empty because the touch controller
* is configured to work with interrupts.
*
* For the polling version of this example, see Touch_Polling.ino
*
*
* Instructions:
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063) board .
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063)
* board .
* 2. Upload this sketch to your board.
* 3. Open the Serial Monitor.
* 4. Touch the screen with your finger(s) and view the coordinates printed on the Serial Monitor.
*
* 4. Touch the screen with your finger(s) and view the coordinates printed on
* the Serial Monitor.
*
* Initial author: Leonardo Cavagnis @leonardocavagnis
* Created: 03 May 2023
*/
Expand All @@ -21,7 +28,7 @@

Arduino_GigaDisplayTouch touchDetector;

void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) {
void gigaTouchHandler(uint8_t contacts, GDTpoint_t *points) {
Serial.print("Contacts: ");
Serial.println(contacts);

Expand All @@ -35,16 +42,18 @@ void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) {

void setup() {
Serial.begin(115200);
while(!Serial) {}
while (!Serial) {
}

if (touchDetector.begin()) {
Serial.println("Touch controller init - OK");
} else {
Serial.println("Touch controller init - FAILED");
while(1) ;
while (1)
;
}

touchDetector.onDetect(gigaTouchHandler);
}

void loop() { }
void loop() {}
34 changes: 21 additions & 13 deletions examples/Touch_Polling/Touch_Polling.ino
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/*
/*
* Touch_Polling.ino
*
* This example shows how to get the number of points and the coordinates of the first touch points detected by the touch controller using polling.
*
* The setup() function initializes the serial communication and the touch controller. The loop() function continuously checks to see if a touch event is detected. Whenever a touch event is detcted, that prints the number of points and first touch co-ordinates to the Serial Monitor.
*
*
* This example shows how to get the number of points and the coordinates of the
* first touch points detected by the touch controller using polling.
*
* The setup() function initializes the serial communication and the touch
* controller. The loop() function continuously checks to see if a touch event
* is detected. Whenever a touch event is detcted, that prints the number of
* points and first touch co-ordinates to the Serial Monitor.
*
* For the interrupt version of this example, see Touch_IRQ.ino
*
*
* Instructions:
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063) board .
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063)
* board .
* 2. Upload this sketch to your board.
* 3. Open the Serial Monitor.
* 4. Touch the screen with your finger(s) and view the coordinates printed on the Serial Monitor.
*
* 4. Touch the screen with your finger(s) and view the coordinates printed on
* the Serial Monitor.
*
* Initial author: Leonardo Cavagnis @leonardocavagnis
* Created: 03 May 2023
*/
Expand All @@ -23,20 +29,22 @@ Arduino_GigaDisplayTouch touchDetector;

void setup() {
Serial.begin(115200);
while(!Serial) {}
while (!Serial) {
}

if (touchDetector.begin()) {
Serial.print("Touch controller init - OK");
} else {
Serial.print("Touch controller init - FAILED");
while(1) ;
while (1)
;
}
}

void loop() {
uint8_t contacts;
GDTpoint_t points[5];

contacts = touchDetector.getTouchPoints(points);

if (contacts > 0) {
Expand Down
265 changes: 0 additions & 265 deletions src/Arduino_GigaDisplayTouch.cpp

This file was deleted.

Loading