Giga Display touch detection not working

first of all - hello everyone. I'm new to this forum.

I've just received my Giga Display for Arduino Giga R1. Unfortunately I have problems with touch detection. It is not working. I've noticed that this code:

Arduino_GigaDisplayTouch TouchDetector;
TouchDetector.begin();

is always returning false. I've tried to write my own code and to run Giga Display official examples like LVGLDemo. It is drawing objects correctly (I can see buttons and other stuff) but there is no reaction when I'm touching screen with my finger (ie. pressing a button, selecting a checkbox, etc.).

I have latest versions of all required libraries (excluding LVGL - I have 8.3.11) and Giga board in 4.0.10 version.

I've also noticed that the LCD "blink" example for the Giga Display is not working. The LCD is not blinking.

First of all I would like to determine if my display is damaged and I should do a warranty return. Please help me with that.

If it is not a hardware issue I would need help with solving software issues (how to run touch control on my display).

best regards,
Dominik

Ould it be that the screen is not connected correctly. Are all the pins attached?

Yes, I've checked it few times before writing here.

Follow the guide https://docs.arduino.cc/tutorials/giga-display-shield/getting-started/ and make sure that you install the last Package Core for Giga and also all the Display libraries including that for the touch ( Arduino_GigaDisplayTouch) and run the IDE examples.

Hi @dchrzan,
Try to run the example Touch_Polling of the Arduino_GigaDisplayTouch.

Before running the example, add a Serial.println(status) here, and let us know what error code is:

    // ...
    status = _wire.endTransmission();
    
    Serial.print("Error code: ");
    Serial.println(status); // print error code
    
    if (status) return status;
    // ...

not sure what exactly I should do. I've tried (with no success) to modify Touch_Polling code like:

/*
  Touch_Polling

  created 03 May 2023
  by Leonardo Cavagnis
*/

#include "Arduino_GigaDisplayTouch.h"
#include "Wire.h"

Arduino_GigaDisplayTouch touchDetector;
TwoWire          _wire;

void setup() {
  Serial.begin(115200);
  while(!Serial) {}
 
 uint8_t status = 0;
 _wire.setClock(400000); /* maximum transmission rate of 400K bps */
    _wire.begin();
  status = _wire.endTransmission();
    
    Serial.print("Error code: ");
    Serial.println(status); // print error code

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

Nope, you have to modify this file of the library and not the example sketch:

ok. done. Error code: 2

1 Like

Try to substitute this line:

with:
uint8_t addr = GT911_I2C_ADDR_28_29);

done. No results.

It could be an hardware problem :frowning_face:

:frowning:

thanks for your time and help. I will try to find someone with another Giga R1 board to check if it is a display or board problem. Then I will do a warranty return.

best regards

1 Like

Open a ticket with Arduino Support team via Contact us

I already did. :wink:

1 Like

Same x2

Yesterday I've received new Giga Display. Unfortunately I have exactly the same problems. I did the same tests. Results are as previous... :frowning:

1 Like

Hi, sorry to hear this. can you try to open up a follow-up ticket with us?
Did you get a replacement GIGA R1 WiFi and Display shield or just the Display shield?

Were you able to run the test on a different board?

I have have had my display for a little while now, but never tried the touch.

So thought I should try mine. It appears to work.

So far I just tried it with the polling, which worked, so had a little fun and
did a quick and dirty conversion of the Adafruit GFX example touchpaint
that they have for several of their displays.

In this case I started from their ILI9341 library....

/***************************************************
  This is our touchscreen painting example for the Adafruit ILI9341 Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

REDIRECT_STDOUT_TO(Serial)
#include "Arduino_GigaDisplay_GFX.h"
#include "Arduino_GigaDisplayTouch.h"

GigaDisplay_GFX display;
Arduino_GigaDisplayTouch touchDetector;


#include "Arduino_GigaDisplay_GFX.h"
#define GC9A01A_CYAN 0x07FF
#define GC9A01A_RED 0xf800
#define GC9A01A_BLUE 0x001F
#define GC9A01A_GREEN 0x07E0
#define GC9A01A_MAGENTA 0xF81F
#define GC9A01A_WHITE 0xffff
#define GC9A01A_BLACK 0x0000
#define GC9A01A_YELLOW 0xFFE0
// The buffer used to rotate and resize the frame


// Size of the color selection boxes and the paintbrush size
#define BOXSIZE 80
#define PENRADIUS 5
int oldcolor, currentcolor;

void setup(void) {
  // while (!Serial);     // used for leonardo debugging

  Serial.begin(9600);
  Serial.println(F("Touch Paint!"));

  display.begin();

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

  display.fillScreen(GC9A01A_BLACK);

  // make the color selection boxes
  display.fillRect(0, 0, BOXSIZE, BOXSIZE, GC9A01A_RED);
  display.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, GC9A01A_YELLOW);
  display.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, GC9A01A_GREEN);
  display.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, GC9A01A_CYAN);
  display.fillRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, GC9A01A_BLUE);
  display.fillRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, GC9A01A_MAGENTA);

  // select the current color 'red'
  display.drawRect(0, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
  currentcolor = GC9A01A_RED;
}


void loop() {

  uint8_t contacts;
  GDTpoint_t points[5];
  contacts = touchDetector.getTouchPoints(points);

  if (contacts == 0) return;

  // Retrieve a point
  int touch_x = points[0].x;
  int touch_y = points[0].y;

  /*
  Serial.print("X = "); Serial.print(touch_x);
  Serial.print("\tY = "); Serial.print(touch_y);
  Serial.print("\tPressure = "); Serial.println(p.z);  
 */

  // Scale from ~0->4000 to display.width using the calibration #'s
//  touch_x = map(touch_x, TS_MINX, TS_MAXX, 0, display.width());
//  touch_y = map(touch_y, TS_MINY, TS_MAXY, 0, display.height());

  /*
  Serial.print("("); Serial.print(touch_x);
  Serial.print(", "); Serial.print(touch_y);
  Serial.println(")");
  */

  if (touch_y < BOXSIZE) {
    oldcolor = currentcolor;

    if (touch_x < BOXSIZE) {
      currentcolor = GC9A01A_RED;
      display.drawRect(0, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    } else if (touch_x < BOXSIZE * 2) {
      currentcolor = GC9A01A_YELLOW;
      display.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    } else if (touch_x < BOXSIZE * 3) {
      currentcolor = GC9A01A_GREEN;
      display.drawRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    } else if (touch_x < BOXSIZE * 4) {
      currentcolor = GC9A01A_CYAN;
      display.drawRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    } else if (touch_x < BOXSIZE * 5) {
      currentcolor = GC9A01A_BLUE;
      display.drawRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    } else if (touch_x < BOXSIZE * 6) {
      currentcolor = GC9A01A_MAGENTA;
      display.drawRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, GC9A01A_WHITE);
    }

    if (oldcolor != currentcolor) {
      if (oldcolor == GC9A01A_RED)
        display.fillRect(0, 0, BOXSIZE, BOXSIZE, GC9A01A_RED);
      if (oldcolor == GC9A01A_YELLOW)
        display.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, GC9A01A_YELLOW);
      if (oldcolor == GC9A01A_GREEN)
        display.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, GC9A01A_GREEN);
      if (oldcolor == GC9A01A_CYAN)
        display.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, GC9A01A_CYAN);
      if (oldcolor == GC9A01A_BLUE)
        display.fillRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, GC9A01A_BLUE);
      if (oldcolor == GC9A01A_MAGENTA)
        display.fillRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, GC9A01A_MAGENTA);
    }
  }
  if (((touch_y - PENRADIUS) > BOXSIZE) && ((touch_y + PENRADIUS) < display.height())) {
    display.fillCircle(touch_x, touch_y, PENRADIUS, currentcolor);
  }
}

I got another display. Fresh. Error code 2. Same problem twice. Makes me feel you guys screwed up a whole batch of display shields or...or..the board package/display library.

Hi

On Thursday I've emailed support answering in previous email thread (ticket 284253). Unfortunately I haven't got any answer yet, so is wired because last time responses were very quick. Should I open a new ticket?

Just the Display shield - as was suggested by support. I've bought the Display and the Board in two different stores and it can be a little hard to replace the Boars (right now I have no arguments for the shop to make them to do that - excluding the Display everything else I've tested on this board is running fine).

I've got no second Giga Board. I will try to find anyone local who may have a second one and will be willing to help me with such a test.
My second Arduino board is Uno R4 WiFi. Is there any chance to connect it to Uno R4 and perform Giga Display tests using this board?