Touch screen button led toggle

Touch screen button led toggle

It is the same situation as toggling a regular push button.

You need to debounce any "press". Detect a "release". Determine whether it was a valid press or release. And toggle the "state" of a variable.

It would be much easier to use the Adafruit_GFX_Button class.
i.e. justPressed() and justReleased()

David.

Calibrate the Touch panel and copy-paste the values into the example sketch.

Yes i managed with “TouchScreen_kbv.h”. Thanks.