OLED adafruit libary, refresh by section instead entire screen.

Hello,

I have been able to draw things and plot things from analog Input however I don’t know if there is technique for this.

Instead of clearing the entire screen and redrawing everything which I am currently doing which causes a rolling animation effect, is there a way that I only clear active sections of the screen and leave other sections static?

Like for instance, a bar graph title and the bar graph level. How can I code it that only the pixels that are getting the bar graph line get updated were the title remains constant?

I would post code, but what I am asking for is an example code for above that I could adapt to my program.

To erase a section of the screen, draw a rectangle with appropriate size and location, filled with background color, and draw new stuff over that.

I have cleared individual lines of text in the same way on an OLED.

Draw a filled box of the background colour over the area the text line occupies.

Thanks guys for the replies I will give this method a try, I hope I can do this without having to do a “blink without delay” technique but I didn’t see it mentioned.

Why don’t you post your current code (or a minimally representative version of it) and describe the actual problem?

Blackfin:
Why don't you post your current code (or a minimally representative version of it) and describe the actual problem?

The posters in the thread clued me in and I was able to work up a crude solution for an example for text, posted below.
Lreadp talks about what the number was previously and Lread is what it is currently, so I had to first erase the shape of the previous text to then get the current text in a clear view... anyways the code. Once I figure out adapting for bargraphs which I think I am very close in a crude solution manner, I will also post code for that too.

Why I am not going full code for this program is that this scrap book rough draft so variable names would come across confusing.

IGNORE THE COMMENTS THEY ARE COPY AND PASTE ARTIFACTS FROM EXAMPLE CODES

isplay.setTextSize(2);      // Normal 1:1 pixel scale

 display.setTextColor(SSD1306_BLACK); // Draw white text
  display.setCursor(35, 30);     // Start at top-left corner
  display.cp437(true);         // Use full 256 char 'Code Page 437' font
  display.print(L_readp);
  
  display.setTextColor(SSD1306_WHITE, SSD1306_BLACK ); // Draw white text
  display.setCursor(35, 30);     // Start at top-left corner
  display.cp437(true);         // Use full 256 char 'Code Page 437' font

  display.print(L_read);

  /////
 display.setTextSize(2);      // Normal 1:1 pixel scale

 display.setTextColor(SSD1306_BLACK); // Draw white text
  display.setCursor(80, 30);     // Start at top-left corner
  display.cp437(true);         // Use full 256 char 'Code Page 437' font
  display.print(R_readp);
  
  display.setTextColor(SSD1306_WHITE, SSD1306_BLACK ); // Draw white text
  display.setCursor(80, 30);     // Start at top-left corner
  display.cp437(true);         // Use full 256 char 'Code Page 437' font

  display.print(R_read);

Okay, pretty much a "WOW! Now I understand..." moment.

Oleds, monocolor ones have THREE color options...but REALLY just two.

BLACK, WHITE, INVERSE.

All of my confusion came out of the fact that I was using INVERSE to make a bar-graph which would make it look really strange.