0

Is there any way to add Inverse Text color function into SSD1306Ascii library like which is available in ssd1306 adafruit library ?

1 Answer 1

2

Yes, you can edit the library yourself, or copy its functions to your sketch and modify them.

You can also use another library, like u8g2.

4
  • Adafruit library uses a buffer and it's using it as a lookup to invert the color. SSD1306Ascii has no buffer, so copying the code over won't work.
    – gre_gor
    Mar 11, 2017 at 16:04
  • @gre_gor I'm not sure I follow your reasoning. The SSD1306Ascii library can be modified to send the right pixels to the display, or you can copy its functions into your sketch and modify them there. As some example starting places, you could add a function similar to SSD1306Ascii::write that inverts the pixel data (b) before sending it to the display; or you could modify the initializer to invert the whole display: change this from SSD1306_NORMALDISPLAY to SSD1306_INVERTDISPLAY. Mar 12, 2017 at 16:19
  • @Chris Combs Since im mainly looking for low memory space i cant use u8g2. library or ssd1306 adafruit library since they occupy relatively a lot of space. Mar 13, 2017 at 7:18
  • @DineshKarthie u8g2's page buffer mode only needs 128 or 256 bytes of ram... if you are referring to program size then you can keep it down by including smaller fonts, more details here: github.com/olikraus/u8g2/blob/master/doc/faq.txt#L124-L127 Mar 13, 2017 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.