Hello everyone, I am relatively new to Arduino. I am using the Giga Display Shield with the Giga R1 board. it displays graphics and text fine and I was hoping to use the touchscreen for a custom project, However, when I try to use the Giga touchscreen library, it fails to initialize. I have tried using the polling example given by Arduino and it is still the same issue, but everything else works as intended. Any suggestions, or would I need to get a new display shield?
/*
Touch_Polling
created 03 May 2023
by Leonardo Cavagnis
*/
#include "Arduino_GigaDisplayTouch.h"
Arduino_GigaDisplayTouch touchDetector;
void setup() {
Serial.begin(115200);
while(!Serial) {}
if (touchDetector.begin()) {
Serial.print("Touch controller init - OK");
} else {
Serial.print("Touch controller init - FAILED");
while(1) ;
}
}
void loop() {
uint8_t contacts;
GDTpoint_t points[5];
contacts = touchDetector.getTouchPoints(points);
if (contacts > 0) {
Serial.print("Contacts: ");
Serial.println(contacts);
for (uint8_t i = 0; i < contacts; i++) {
Serial.print(points[i].x);
Serial.print(" ");
Serial.println(points[i].y);
}
}
delay(1);
}
The shield is mounted to the back of the Giga r1 and is powered by usb-c.
As seen within the code, it uploads fine but displays Touch controller init - FAILED.
#include "Arduino_GigaDisplayTouch.h"
Arduino_GigaDisplayTouch touchDetector;
void setup() {
Serial.begin(115200);
touchDetector.begin();
}
void loop() {
uint8_t contacts;
GDTpoint_t points[5];
contacts = touchDetector.getTouchPoints(points);
if (contacts > 0) { //Check if at least one touch occurs on the screen
//Print the coordinates of all simultaneous contacts detected
for (uint8_t i = 0; i < contacts; i++) {
Serial.print(points[i].x);
Serial.print(" ");
Serial.println(points[i].y);
}
}
}