Attached is my sketch.
My goal is to read the input from the temperature +/- touch regions on the screen (this works), adjust the value stored in the desiredTemp variable (this part works) and then update the display with the new desiredTemp value (this part doesn't work). I'm assuming this is because A1 is shared between the LCD write and the touchscreen X- input.
I've not dealt with this type of problem, so I'm hoping someone can steer me in the write direction, and my google-fu is apparently failing on trying to solve this.
Looking at the Touchscreen_Calibr_native.ino sketch included with MCUFriend_kbv, do I have to setup loops where I am in read mode for a period of time and then in write mode?
Your problem is because the Touch Pins are shared with the TFT
//Just a quick enable of reading the touchpoint to trigger my issue.
TSPoint tp = ts.getPoint();
pinMode(XM, OUTPUT); //.kbv restore XM, XP after calling Touch functions
pinMode(YP, OUTPUT); //.kbv because Touch library left them as INPUT
if (tp.z > MINPRESSURE && tp.z < MAXPRESSURE)
{
xpos = map(tp.y, TS_LEFT, TS_RT, 0, 320);
ypos = map(tp.x, TS_TOP, TS_BOT, 0, 240);
}
Look at the example sketches. They calibrate in PORTRAIT mode.
If you rotate the screen, you have to "rotate" the Touch values. Look at the Touch_Shield_new.ino
example. Experiment with it. e.g. alter the rotation to LANDSCAPE or PORTRAIT_REV. It should still work 100%.
Most projects set the rotation once in setup() and it never alters.