Hi there, I'm posting this within the Programming section to see if I get a better response with assistance in coding a TFT LCD to actively update without leaving any pixels hanging.
I'm using a DHT11 sensor to measure temp/humidity and then have the Adafruit ST7735 1.8" TFT LCD shield display the values. Now this is just sample coding I'm using to start a project of mine so I really need to learn how to control this display better before I make the bigger part of the coding. The code I have now displays the temp and humidity readouts from the DHT11 on the TFT LCD, the arduino is set to read the DHT11 every 5 sec, so naturally if the temp or humidity changes I want the TFT LCD to show that. Thing is if I left the fillscreen code out, the sensors new reads will just write over themselves making it unreadable. I know this has been done before because I've seen some peoples projects have smoother refresh rates with the ST7735, or that is they just had the screen refresh only the areas that have changed without using the fillscreen option. Trust me, my coding makes the screen blink every 5 secs and I would rather something smoother. Can anyone help me here with writing some simple code for this to only erase the old values off the screen and write the new ones without refreshing the whole screen?
On another note, does anyone know how to eliminate the two extra digits off the Temp read? You know round it up, for example 77.50 º F would be 78 º F instead.
I'm honestly not asking this because I'm lazy, I'm asking this because I can't find any sample coding that does what I need so I could apply it to my project.
Before you refresh a variable on screen write a blank or pace for every character printed that needs to be refreshed, Then print the new value.
I own one of the Adafruit ST7735 displays and that's what I did to refresh time when I reprinted the new seconds, minutes...
Before you refresh a variable on screen write a blank or pace for every character printed that needs to be refreshed, Then print the new value.
I own one of the Adafruit ST7735 displays and that's what I did to refresh time when I reprinted the new seconds, minutes...
Bob
Yeah, lol I thought of this as soon as I logged for the evening. Something about taking a break help me think a little harder about how I could code this. So I just took a few minutes this afternoon to write in that bit of code and now I can refresh it nicely without having the whole screen blink.
This sample should do just fine to help me code the bigger portion of my project. The next thing I have to work on is interfacing a relay controller that will flip a few low voltage solenoid valves.
Docedison:
Before you refresh a variable on screen write a blank or pace for every character printed that needs to be refreshed, Then print the new value.
I own one of the Adafruit ST7735 displays and that's what I did to refresh time when I reprinted the new seconds, minutes...