Touchscreen buttons

I purchased a Arduino Mega 2560 and a 2.8" TFTLCD (ID 2830) from Jaycar.
I want a sketch for a two (or more) button controller - buttons "OPEN" & "CLOSE". I have tried many of the Googled suggestions however the buttons dont seem to work for most of them.
The closest is the MCUFRIEND_kbv example of 'button_simple' - the buttons work after completing 'Touchscreen_Calibr_native' however I want it in landscape. When I set landscape and relocate the buttons the buttons touch area remains in the original spot and the buttons dont work???
Any suggestions would be much appreciated.
Thanks

Look at the TouchShield_kbv example. It shows you how to use the Touch in different Rotations.

Hint. Edit the example to run in Landscape mode. Portrait_Rev, ...

:slight_smile: Thanks, got it.

Hello, I have LCD module TFT 2.4 inch shield on ESP32 Wemos D1 Mini.
'TouchScreen_Calibr_native' working with touch pins XP=12,XM=15,YP=33,YM=13,

but 'Button_simple' not working with output from TouchScreen_Calibr_native.
What is wrong?
Thanks advance.

The Adafruit "TouchScreen.h" library does not work very well with ESP32.

"Touchscreen_kbv.h" and "Touchscreen_kbv.cpp" files can be copied to local sketch tabs.

I copy-pasted the Calibration for my Blue 320x480 Shield:

const int XP=15,XM=12,YP=13,YM=33; //320x480 ID=0x7796
const int TS_LEFT=107,TS_RT=892,TS_TOP=935,TS_BOT=5;

And ran button_simple.ino on an ESP32.

I suggest that you start with Touch_shield_new.ino first
It shows you Touch values and you can observe the Calibration accuracy.

David.

Thanks. I will try,
Ol

Very very thanks. I have changed Touchscreen witn Touchscreen_kbv and got working thing.
my code:

const int XP=12, XM=15, YP=33, YM=13;
const int TS_LEFT=141,TS_RT=933,TS_TOP=109,TS_BOT=943;

Magic. Yours great job.

< test >

Test what? :roll_eyes: