TinyCircuits

TinyScreen Artifacts after text replacement

TinyScreen Artifacts after text replacement
« on: July 20, 2018, 04:05:30 PM »
I'm developing a Thermostat controller for my RV fridge. The display has a Static border and some static text. On the display I am displaying 2 variables. A set temp and a actual temp. The Actual temp varies. When a new value is written to the display It will at times leave artifacts of the previous value.  Value of 68.88 being replaced with 65.01 will leave artifacts of the 68.88 on the trailing edge. Is there a method to just blank out the previous text. I tried doing a draw rectangle filled, but it would make the temp number constantly flash. I'm at a loss at this point.
I've attached a txt file with the project code and would appreciate any insight. BTW the set temp routine has not been fleshed out yet.

Thanks
Bill

Retired industrial controls engineer

Re: TinyScreen Artifacts after text replacement
« Reply #1 on: July 20, 2018, 07:06:40 PM »
Hello!

I'm not sure if I'm understanding what you mean by artifacts, but to clear values there is a clear screen function you can use. This may be what you've already tried as it makes the screen 'blip' between prints:

  display.clearScreen();

If you're looking for something more refined, please let me know!

Thanks,
Réna

Re: TinyScreen Artifacts after text replacement
« Reply #2 on: July 20, 2018, 09:15:24 PM »
When a temp value if first printed to the screen it shows up clearly. If the value contains a value like 67.89 when first displayed it is backed completely by black. If the temperature changes to a value that contains a 1 in it like 43.21, the original value is overwritten, But the black background does not completely cover the original 78.89, It will leave a vertical row of pixels spaced out 1 pixel to the right of the 43.21 making it look like 43.21| . This  appears to be remaining from what I believe is part of the 9 the original 67.89.  I am using the liberationSans12pt font and it appears that the sizes of the individual characters effect the display when over-writing a value.

If I add a filled rectangle

display.drawRect(51, 9,  39, 14, BLANK, BLK); // Blank out prior (DsplyF) prior to  new (DsplyF) write

display.setFont(liberationSans_12ptFontInfo); // set Font
display.setCursor(52, 10); // move Cursor to Actual Temp position
display.print(DsplyF);

        It does clear the background But I end up with a flashing (DsplyF) Not the entire display just the updated
        temperature value.

 BLANK declared as
#define BLANK  TSRectangleFilled // Defines Blank Rectangle.

I'll work tonight to duplicate with a simpler program and post that.
Bill

Retired industrial controls engineer

Re: TinyScreen Artifacts after text replacement
« Reply #3 on: July 25, 2018, 05:09:55 PM »
Rena

Thanks for your offer. I beat my head against a wall after I duplicated the problem with a smaller program. Since I don't have the same problem using a larger font, I just dropped the display temp down to 2 digits. The code is now working within design parameters and I just had the custome expansion board sent out to fab. Hope to put this one in the completed column in a couple of weeks.

Regards
bill
Bill

Retired industrial controls engineer