Adafruit_SSD1306_PLUS (I2c only)
as I’m working on my MP3 player project, I needed to do some adapts to the Adafruit_SSD1306SSD1306Displays, touch panels and LEDs…SPI bus for the tf card from the board anyway. I had one of those 0.96″ oled modules( ssd1306 ) connected to mks sbase v1.3 before I fried the board so I think I’ll try that displ…View in hardware catalog library (included in Rogers core, adapted by myself some years ago).
Warning: This library was only tested with a 128×64 I2C Oled without RST pin. For SPI you need to adapt my new I2C functions!
Here some changes:
full speed HW I2C again (was modified by someone, but forgotten to insert a Wire.setClock(400000) after Wire.begin
encapsulated the whole screen buffer from private to public. This “costs” only 1KB (on a 128×64 display) But now you can copy the buffer into a temporary array, do something on screen and after that putting the state before on screen again. So with other words: You don’t need to take care what was on screen before. Saves many lines of code
delete the pre built adafruit logos in the buffer: Saves flash memory (about 1KB)
Not only full screen update, but pages:
Ok, the screen is only 1024 bytes, but with I2C this can be a lot of time, so I read the datasheet of SSD1306SSD1306Displays, touch panels and LEDs…SPI bus for the tf card from the board anyway. I had one of those 0.96″ oled modules( ssd1306 ) connected to mks sbase v1.3 before I fried the board so I think I’ll try that displ…View in hardware catalog and recognized that the screen can also be updated by pages (8 lines), so you have 8 pages on a 128×64 display. Here is a practical example:
void oled_invert_entry(byte page) {
for (int z = 0; z < 128; z++) {
display.buffer[z + page* 128] = ~display.buffer[z + page * 128]; // invert page
}
display.display(page, page );
}