0

Featherwing 2.4" TFT
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Featherwing 2.4" TFT

by abear7 on Sat Mar 10, 2018 3:41 pm

Hello, I have the demo running OK and I'm trying a simple display now. I want just fixed text and a timer to update smoothly every second.
How do you get it to just update a timer value on the screen without having to rewrite the whole screen to avoid flicker from using the fillScreen(...BLACK); function?

Thanks

abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: Featherwing 2.4" TFT

by coburn64 on Sat Mar 10, 2018 7:54 pm

I believe the draw text functions support a background color parameter. I do remember that you could do something like drawText("blah", WHITE, BLACK, 0,0) (maybe it's setBackgroundColor and setColor ?) or something to that extent. I think then internally the text drawing function will draw a filled box over the area you want the text drawn before it draws the font.

coburn64
 
Posts: 2
Joined: Sat Mar 10, 2018 7:48 pm

Re: Featherwing 2.4" TFT

by abear7 on Mon Mar 12, 2018 9:14 pm

I saw and tried some of these functions but the IDE says function not found for some reason.


void setCursor(uint16_t x0, uint16_t y0);
void setTextColor(uint16_t color);
void setTextColor(uint16_t color, uint16_t backgroundcolor); void setTextSize(uint8_t size);
void setTextWrap(boolean w);

The only way I've been able to work around this is remember every character I print and go print that again in Black before printing at that location again. Am I the only one who has this problem?
I'm using code like this below which the demo had several examples of:

tft.setTextSize(2);
tft.print("new message");

These are the header files which the demo already included.
Help would be much appreciated.
Thanks


Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: Featherwing 2.4" TFT

by abear7 on Fri Mar 23, 2018 9:29 pm

Hello, I'm still having this issue. None of the demos demonstrate rewriting text to a same location on the screen without blanking out the whole screen first so I'm wondering if this is just how it works. Any assistance would be appreciated.

Thanks

abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: Featherwing 2.4" TFT

by BryonMiller on Sat Mar 24, 2018 10:02 am

Rather than a fillscreen I write a black rectangle on top of the old text to be replaced

Something like

Code: Select all | TOGGLE FULL SIZE
tft.fillRect(X,Y,27*6*3,8*3,BLACK);

where
X      is the x coordinate of the text I was using
Y      is the y coordinate of the text I was using
27     is the maximum number of old characters I was using
6      is the library x width of a single character
3      is text size I was using
8      is the library y height of a single character

BryonMiller
 
Posts: 107
Joined: Fri Mar 04, 2016 10:34 am

Re: Featherwing 2.4" TFT

by abear7 on Sat Mar 24, 2018 11:30 am

Hello, Yes I thought of doing that also. I was hoping there was something simpler. If I redo the layout and keep static areas unmodified and use this approach over areas that change this might make things a bit easier.
Thanks

abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Re: Featherwing 2.4" TFT

by abear7 on Fri Mar 30, 2018 4:17 pm

This approaching is working fine. I just wished I knew this before hand, which would have saved me frustration and time.
Thanks

abear7
 
Posts: 21
Joined: Sun Jul 05, 2015 12:01 pm

Please be positive and constructive with your questions and comments.