Solved: using keypad makes unexpected shift in position of tft.drawNumber & tft.drawString (left and up) #2132
-
hi Bodmer . |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Provide an example sketch that demonstrates the problem. |
Beta Was this translation helpful? Give feedback.
-
above source code file (Arduino IDE format .ino ) attached here |
Beta Was this translation helpful? Give feedback.
-
The problem is that the text datum is being changed whenever the redBtn() and greenBtn() functions are called. The default is top left datum and this is over-ridden. The setTextDatum is a "global" function so changes the position of text subsequently drawn on the screen. Here are updated functions that restores the datum to the same setting as when the function was called. If you use these functions then I think your sketch will behave as you expect.
|
Beta Was this translation helpful? Give feedback.
The problem is that the text datum is being changed whenever the redBtn() and greenBtn() functions are called. The default is top left datum and this is over-ridden. The setTextDatum is a "global" function so changes the position of text subsequently drawn on the screen.
Here are updated functions that restores the datum to the same setting as when the function was called. If you use these functions then I think your sketch will behave as you expect.