Hi yall,
I'm making a temperature controller for my grill (prepare for the super bowl ) I try to use an Oled to display the temperature reading. First, I tried the adafuirt library. Unfortunately, the memory was over the limit, so I found out a smaller library called MicroLCD. It display the temperature without any problem. However, I have hard time to clear the screen.
here is when it start:
as you can see, when it turn back to initial state, the last few letters of the "MAX BLOW"" still on the screen, and the fan % become 000 which I guess the last two "0" was from 100.
I did try use clear() in the library that I use. It will cause the screen blinking.
I will attach the library.
Could anybody help me figure out how to erase the letter without make the led blinking?
Thank you very much.
tried to insert code, but it was over the 9000 letters limit
please see attached txt file for the code. I deleted part of it since it's from my friend who don't want me post it on here (idk why). anyway, it will not effect the display function.
Grumpy_Mike:
Simply draw (print ) some spaces after you draw the number.
Alternately draw a black rectangle over the old number before you draw the new one. That is if your library supports filled rectangles.
The library that I use does not support draw rectangular, but you inspire me that I can print many space instead of rectangular.
Now it will not blinking the whole screen, but it still blinking the area where I draw the space.
The way most of those drivers work, is that the display is buffered. All the graphics and text commands modify only the buffer. There is no effect on the display. There is a function to write the buffer to the screen, perhaps called update() or something (depends on the library). That function will blink the screen a little because it's so slow. It is the programmers responsibility to do as many graphics and text commands as possible, before calling update(). If your code is writing the buffer every time you write a text character, for example, it will cause terrible blinking of the screen.
Another this you might try is some drivers have more than 128. Just write a simple sketch to go from character 32 to 255...
On the ones I use from adafruit and element 14 have a cursor block. Try printing that in background color.
I have not looked at your code yet, but maybe in line with what aarg is saying, maybe you could check if the variable has changed before deciding to write it to the screed.