Playing with a DigiSpark & SSD1306 0.96" OLED

Examples, screenshots, graphics, fonts...
Post Reply
User avatar
Posts: 637
Joined: 15 Feb 2018, 23:32

Playing with a DigiSpark & SSD1306 0.96" OLED

Post by Phil_G »

I was just browsing stuff and happened across this: ... at-Things/
Its a simplified OLED library for the 0.96" OLEDs for the DigiSpark or any ATTiny85, minimalised to preserve memory on the ATTiny85. For text, it has only one font which is 5x7, so quite small to read but very clear, you get 20 characters by 8 lines, four lines if double spaced.

Connections to the display are +5, 0v, SDA (DigiSpark P0) and SCL (DigiSpark P2)




Just thought it was a handy library worth saving, great for DigiSpark projects.

As with most of these libraries, theres no documentation so you have to work out how to use it. I've sussed the graphics format, basically its vertical bytes from top left, across left to right, next row, etc to bottom right, with the msb of each byte at the bottom. Taking the thermometer as an example


(this took me ages to draw!):


You can create a new graphic using PaintShop Pro or similar, actual size, two-colour, then import it into the excellent conversion utility that Max found the other day:

Posts: 57
Joined: 25 Feb 2018, 17:59

Re: Playing with a DigiSpark & SSD1306 0.96" OLED

Post by FBMinis »

Thank you Phil for another interesting experiment.
User avatar
Posts: 694
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: Playing with a DigiSpark & SSD1306 0.96" OLED

Post by Mike_K »

If anybody wants a play with an ATtiny85 and the SSD1306 OLED library and are having problems working out how it all works there's actually plenty of documentation relevant to this library, as it's based on the Adafruit OLED/GFX graphics library, everything about the Adafruit SSD1306 applies. The original Adafruit library is here:

and ... d-examples

The Adafruit library comes with examples and many projects on the web are based on it, so you can see how others have used it. To see example programs in Arduino, first, ensure the Adafruit SSD1306 library is installed using the Arduino libraries manager. You should then be able to find examples under File -> Examples (Examples from customer libraries). You will obviously have to change the #includes etc to the minimal library for programs/sketch examples to work with the ATtiny85.

The advantage of the minimal library is it uses the "soft" I2C library as the ATtiny85 hasn't got a native I2C port and doesn't use a page buffer to store the image as the ATtiny85 hasn't got enough RAM to hold it. Even though the ATtiny85 hasn't got a native I2C port, it has the USI – Universal Serial Interface that can be utilised for I2C (or other serial coms), that the USI_TWI_Master and TinyWireM libraries make use of, though the underlying driver is the same as the Adafruit OLED driver.

And if you want to convert bmp images to cpp (and rotate thro' 90 deg to get it correct orientation for the Adafruit library) I use the excellent GIMP graphics tool, that is open source and a free download. I still use a years old version, I think you now have to "export" rather than "save as".


Post Reply