TFT LCD display
Topic: TFT LCD display
(Read 226 times)
TFT LCD display
Jun 17, 2019, 12:13 am
I am attempting to create an interface screen using an TFT LCD touchscreen. The screen is meant to represent a menu and when you select one option it will transition to a different screen with different options. It works initially but while the transition to the first screen is initially successful when i press down in an attempt to transition to another screen nothing happens. Anyone have any suggestions?
Re: TFT LCD display
Jun 17, 2019, 08:00 am
It will be helpful to share your code so that we can zero in on the particular issue you are facing and/or perhaps offer other suggestions based on your approach.
In general, people often get tripped up when creating & handling multiple pages because they are attempting to do the touch detection & redraw in one nested IF statement.
A few general suggestions in advance of seeing your code:
Ensure your touch coordinates are reading back to where you expect them to be. I often find it useful (in debug) to draw a tiny colored rectangle at the location of each touch read. This helps elimate any touch-to-display mapping issues.
Ensure button touch events are triggered by a change in touch state (ie. From pressed to non-pressed). This helps avoid issues with menu buttons that "fall through" multiple pages.
Maintain a state variable to indicate the current page
Maintain a variable to track whether the screen needs redrawing. Any time a page transition is needed, assert this flag (set to true). In the main loop check the status of this variable and only draw the current page if it is set. Clear the flag after redrawing.
Once we've seen your code, much more specific feedback can be shared.
Arduino GUI - https://github.com/ImpulseAdventure/GUIslice