Flexible OLED Help

I am trying to use the flexible OLED 1.8" and can get all the examples to work. I created a custom graphics with the python code provided. I would like to have the graphics remain on the screen while I update text/other parameters but it appears the command flexibleOLED.data() is used to write each individual pixel for the graphic but will be overwritten by the command flexibleOLED.display() that is used to write text to the display. Any advice on how to keep the graphics and update text? I am trying to have the graphic on the left portion of the display and then have parameters that get updated regularly on the right side of the screen.

Due to the way the display and libraries work, text will overwrite any graphics underneath the text. What you would need to do is draw the background, then print your text and when you want to change text, you have to re-draw the background and then reprint the text with the changes you were looking to make.

The only other way around this would be to keep track of what pixel values were under the text, and then re-write just those values to ‘erase’ the text but that might be memory intensive keeping track of what pixels need changed and what values those pixels hold.

How do you print text with the graphics? Currently each pixel is displayed and the command to display text overwrites the graphics.

I don’t have a display here to try with. Does printing text create a black background with white text over-top the graphics? If so, the code that generates text in the library would need to be modified to only modify the pixels that make up the letters in the text and leave the background alone.

Essentially the library we provide was never intended to do what you’re trying to do and you are going to need to make modifications to get it to function the way you want. Sadly we can’t assist with the changes you’d need to make but it should be doable with some work on the code.