Pages: [1]   Go Down
Author Topic: 3.2 TFT GLCD, Touch Screen with Arduino Mega Control Screen  (Read 154 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been having some issues trying to get the buttons on the touch screen to work, currently I have 2 versions of the code. The first one using if statements and the second one using switch/case statements, both of which yield the same result which is only displaying a message expected to happen when buttons aren't pressed.  Any help would be appreciated on getting the buttons to work when pressed. Sorry about the long post given the attached code.

* good_temp_step_menu_mod2.ino (23.35 KB - downloaded 8 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the if statement version:

* good_temp_step_menu_mod.ino (23.09 KB - downloaded 8 times.)
Logged

Offline Offline
Full Member
***
Karma: 7
Posts: 142
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Had a quick look and both solutions should do something .. Fairly sure problem steams from fact that.. If no touch your

while (true)  ... loop has nothing so compiler optimizes this ode route to no operation, register only  looping, had similar situation myself.

 Now although I am not a fan of the UTFT touch library it does work provided the linearity of your display is within his default requirement. .. The code for detecting touch  will try and activate but the way UTouch detects touch will be crippled by your loop skipping round making it nearly impossible for the touch library code to set available.

Simple way of proving this hypothesis, stickl a delay(2) in the else clause of touch available so in a no touch situation your loop delays and yields to the touch library code allowing it to set the available flag..

I posted previously some outline code handling initial touch detection by Interrupt thereby eliminating this type of situation..

Happy coding   smiley-cool smiley-cool

Logged

Pages: [1]   Go Up
Jump to: