I would like to put an anti-rebound part to avoid having 2 touches registered in the same 100ms for example.
Arduino Serial Buffer Clear Code To DoI tried to find the code to do this in the library but cannot find what I am looking for.Is there a way to clear the buffer after reading the first value of x and y or to do a add an anti-rebound to avoid this I tried the other function: You can also wait for a touch if ( ts.touched()) return; by putting p.x 0; and p.y 0; after doing what I wanted I thought it would work but no, the touch screen keeps sending the last value that was touched. I was then thinking of putting a condition on when to get the new values (like if they are the same as before, do not use them), but I would still have this rebound issue. Ask an Engineer Show and tell, every Wednesday night Help with your Arduino projects START HERE Adafruit blog for how-tos, projects more Adafruit on Google Adafruit on Twitter. I would like in the future to add a virtual keyboard and I was scared that because of this rebound I would have multiple times the same number when just pressing once. I tried to use the example code you provided to create a function that clears the buffer. ![]() I must erase the buffer, because it the previous touched point affects in the last one. Looking through the header files and such I am finding what seems to be inconsistencies. This report would have more information with Show verbose output during compilation enabled in File Preferences. Instead of running the function for the second button pressed, the program will run the code for the previous button. The only thing I was able to find in this mater was the tutorial for the GFX library on your site, what is describing just a small number of functions in this particular library. ![]() This would be a great help for me and everybody here who tries to work with this display.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |