We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reported and triaged by @jojo1212
When using the arduino-libraries/Arduino_GigaDisplayTouch and Arduino_GigaDisplay_GFX libraries together, the GIGA Display Shield shows the previously uploaded sketch content, until you touch the display.
#include "Arduino_GigaDisplay_GFX.h" GigaDisplay_GFX display; #define WHITE 0xffff #define BLACK 0x0000 void setup() { display.begin(); display.fillScreen(WHITE); display.drawTriangle(100, 200, 300, 400, 300, 600, BLACK); display.drawCircle(100, 100, 50, BLACK); display.drawRect(10, 650, 300, 80, BLACK); display.drawRoundRect(300, 50, 100, 100, 30, BLACK); } void loop() {}
#include "Arduino_GigaDisplay_GFX.h" #include "Arduino_GigaDisplayTouch.h" Arduino_GigaDisplayTouch touchDetector; GigaDisplay_GFX display; #define WHITE 0xffff #define BLACK 0x0000 #define screen_size_x 480 #define screen_size_y 800 int touch_x; int touch_y; //increase or decrease the sensitivity of the touch. int trigger_sensitivity = 5; bool switch_1; int counter; void setup() { // put your setup code here, to run once: Serial.begin(9600); display.begin(); 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); counter++; //record the x,y coordinates for (uint8_t i = 0; i < contacts; i++) { touch_x = points[i].x; touch_y = points[i].y; } //as the display is 480x800, any time you touch the screen it will trigger //the trigger sensitivity is set to "5". if (touch_x < screen_size_x && touch_y < screen_size_y && counter > trigger_sensitivity) { switch_1 = !switch_1; Serial.println("switched"); changeSwitch(); delay(250); } } } void changeSwitch() { if (switch_1) { display.fillScreen(BLACK); display.setTextColor(WHITE); } else { display.fillScreen(WHITE); display.setTextColor(BLACK); } display.setCursor(50, screen_size_y/2); display.setTextSize(5); display.print("Switched"); counter = 0; }
SWITCHED
Adding the following section to the setup() function. Suggested by @facchinm
display.begin(); display.startWrite(); display.fillScreen(YELLOW); display.endWrite();
Note: YELLOW needs to be defined.
The text was updated successfully, but these errors were encountered:
Possibly fixed by gilesp1729@58e5a92
Sorry, something went wrong.
No branches or pull requests
Reported and triaged by @jojo1212
When using the arduino-libraries/Arduino_GigaDisplayTouch and Arduino_GigaDisplay_GFX libraries together, the GIGA Display Shield shows the previously uploaded sketch content, until you touch the display.
Steps to recreate the issue
SWITCHED
white text on a white background).Giga.display.mp4
Workaround
Adding the following section to the setup() function. Suggested by @facchinm
Note: YELLOW needs to be defined.
The text was updated successfully, but these errors were encountered: