-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add MultiTouchBlink examples #11
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling begin
/end
, it might make more sense to use the detach
function.
|
||
void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) { | ||
contactPoints = contacts; | ||
touchDetector.end(); // close the touch controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touchDetector.end(); // close the touch controller | |
touchDetector.detach(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see a member function for .detach()
in the Arduino_GigaDisplayTouch.h header. When making the change recommended the following error is given.
C:\GitHub\Arduino\Arduino_GigaDisplayTouch\examples\MultiTouchBlink_IRQ\MultiTouchBlink_IRQ.ino:30:17: error: 'class Arduino_GigaDisplayTouch' has no member named 'detach'
touchDetector.detach(); // close the touch controller
^~~~~~
Using library Arduino_GigaDisplayTouch at version 1.0.1 in folder: C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_GigaDisplayTouch
Using library Wire in folder: C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.1.3\libraries\Wire (legacy)
exit status 1
Compilation error: 'class Arduino_GigaDisplayTouch' has no member named 'detach'
I agree, having a detach()
method would be greatly appreciated 😄 ! See #8
delay(250); | ||
} | ||
contactPoints = 0; | ||
touchDetector.begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touchDetector.begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it is not a pretty
solution, but it works. One should not use begin()
in the middle of a sketch to restart the GT911 module. See: #11 (comment)
The Arduino_GigaDisplayTouch/examples/MultiTouchBlink_Polling/MultiTouchBlink_Polling.ino Line 47 in e1a53e2
|
Co-authored-by: Leonardo Cavagnis <[email protected]>
Co-authored-by: Leonardo Cavagnis <[email protected]>
This PR adds two examples, that blinks the LED on the GIGA R1 WiFi based on the number of touches registered on the screen.
touchDetector.begin();
MultiTouchBlink_IRQ.ino
and polling approachesMultiTouchBlink_Polling.ino
are covered.✨ Thanks for initial testing and feedback by @Hannes7eicher and @pedromsousalima
Closes #10