Disable TouchDisplay Button

I’m programming an Arduino UNO with an MCUFriend touch display, using the Adafruit_GFX library.

I have a series of buttons on the bottom of the screen, and one that, depending on the programed “MODE” (my programming) a button may appear in the middle of the screen. Once the button is pressed, the button needs to disappear.
I have overwritten the area with a “fillRect()” which blacks out the area, but the button gets redrawn.

I’ve looked at the documentation for the library, but I can’t find any way to disable it, and I’ve searched for ways to disable or enable buttons, but I’ve come up blank.

How do I disable the button, until I re-draw it again?


A button is only drawn if you call drawButton()

You typically have a list of Buttons for each different screen.
You check all the buttons in the specific list. Your application behaves accordingly. And possibly redraws buttons, changes screen, etc, …



Thanks for the reply!

I’m not re-drawing the button as far as I know.

I’ll re-check my code.

For now, when I want to delete it, I’ve re-drawn it outside the bounds of the Display, so it can’t be pressed. Not sure if that’s working either…



I have another question for you if you don’t mind, I have an MCUFRIEND 2.4” touch display that I bought a couple years ago. It’s been in my “junk box” for a while.

For my project, I need the I2C comms. I’ve seen forum posts from you talking about cutting the A4 line, and others that list the drivers that allow the A4 line to be cut, and those that don’t. The two drivers that I found on mine have the following markings:

“2LOy12” & “ HC245” and don’t seem to match up with any of the chips that you had mentioned.

Can you identify these? Would I need the Reset pin to run this display?

I’m a Ham Radio operator and built a 1.2KW LDMOS amplifier that is orchestrated by an Arduino MEGA and currently has a 2 line, 16 character display that uses I2C. I’m replacing with the display with an UNO & touch display (somewhat taking my time at it). The comms will be sending a structure back and forth via I2C.


Mike, W0IH


I had these two pictures of the MCUFRIEND device…


Run any of the library examples. Most will report the controller ID.

The TFT controller is not visible to the human eye.
You are simply reading the part numbers of the buffer chips and regulator.

Google those part numbers.



Thanks, I ran a number of the examples and kept coming up with the ID=7785 which appears to be an older one. (Not a surprise.)

I’ll have to purchase a newer one in order to cut the Reset line on A4 to use the I2C.

I can still use this one for doing some early development….

Again, thanks.


Go on. Correct your typos.
There is no 0x7785 nor 0x1e69=7785

Quote the actual ID.



You’re right, It’s 7783.

Don’t know why I missed the last digit.


0x7783 is the ID for a ST7781 controller.

I do not advise snipping LCD_RST pin and pullup to 5V
You can snip LCD_RST and connect to Arduino RESET pin.

You try this at your own risk.



I just ordered a different one…
Thanks for the help.


This topic was automatically closed after 120 days. New replies are no longer allowed.