greiman / SSD1306Ascii

Text only Arduino Library for SSD1306 OLED displays
MIT License
504 stars 121 forks source link

inverted colors (monochrome) #29

Open primvla opened 6 years ago

primvla commented 6 years ago

Hey, im not a programmer, but i needed an 'active' state for my gui elements, so i've hacked your lib with a few lines here:

SSD1306Ascii.h:

and here SSD1306Ascii.cpp, function write:

Then within my sketch i can turn on and off this inverted colors like such:

oled.println("Hello world!."); // white on black
oled.invert();
oled.println("inverted"); // black on white
oled.invert();
oled.println("A long line may be truncated"); // white on black again

I am aware this is a dirty dirty hack, but you could include a similar functionality in the library since it doesn't take much space and is potentially quite useful...

cheers!