Add MultiTouchBlink examples#11
Conversation
leonardocavagnis
left a comment
There was a problem hiding this comment.
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.
| touchDetector.end(); // close the touch controller | |
| touchDetector.detach(); |
There was a problem hiding this comment.
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.
| touchDetector.begin(); |
There was a problem hiding this comment.
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
|
Co-authored-by: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com>
Co-authored-by: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com>
|
|
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.inoand polling approachesMultiTouchBlink_Polling.inoare covered.✨ Thanks for initial testing and feedback by @Hannes7eicher and @pedromsousalima
Closes #10