0

GFX_button class
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

GFX_button class

by Jacques_Verl on Fri Jan 08, 2021 4:55 pm

Hello,
I'm a newby here. I want to make a project with a TFT touchscreen were a button is working as an ON/OFF switch for a LED device. I want to use the same button with the text ON or OFF and background color RED or GREEN. But I cannot change the content of the button, when I read the class references. I tried this code, but it 's not working eather. I still see the initial button.
Any ideas?
Thanks
Jacques
Attachments
Test_tft_V2.ino
(4.25 KiB) Downloaded 11 times

Jacques_Verl
 
Posts: 1
Joined: Fri Jan 08, 2021 4:40 pm

Re: GFX_button class

by asteroid on Mon Feb 01, 2021 12:16 am

You appear to be using an MCUFriend touch screen and I do not have one of those so I substituted code for a capacitative Adafruit _FT6206. It appears that your loop() is not getting called. Insert a Serial.println("something"); into your loop and see if it gets printed out in the Serial Monitor. If you do not see output, try to figure out why the loop() is not getting called. It may be because you do not call ts.begin() in the setup.

asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

Please be positive and constructive with your questions and comments.