SSD1306xLED is a C library for working with the SSD1306 display driver to control dot matrix OLED/PLED 128×64 displays. It is intended to be used with the Tinusaur board but should also work with any other board based on ATtiny85 or similar microcontroller.

The 128×64 OLED is controlled by a SSD1306 circuit and could be interfaced over I²C.

The code could be divided in 3 pieces:

Communication over I²C with the SSD1306;

Sending graphical commands to the display;

High-level functions such as printing characters.

The I²C communication part is based on a code from the IIC_wtihout_ACK library that is available on the Internet but its original website (http://www.14blog.com/archives/1358) is no longer functional. Basically, the SSD1306xLED library makes SSD1306 to work with ATtiny85 and Tinusaur.

How to use it

Using this library to control an OLDE display is very easy. The necessary header files that should be included with the program could be found in the source code repository – the link is at the bottom of this document.

Hi everyone! I must have been doing something wrong in the beginning, but as promised following my findings:

I coded it both ways: via WinAVR (using pure C programming) and via Arduino IDE. Why? You know…just for the heck of it! And it worked both ways.
Use of WinAVR is straight forward since the library is C based. For Arduino IDE I renamed the library from .c to .cpp and copied them in the libraries folder of my sketchbook usually in “..\\My documents\Arduino\libraries”.

I’ve modified: main() to setup() and for(;;) to loop(); I didn’t have to include “Arduino.h” nor included extern”C”. Beware, as Naven pointed out, that there might be sketches were you might need to do this.

At the beginning of the sketch I just included the following header files:
#include “ssd1306xled.h”
#include “ssd1306xled8x16.h”

in my sketch folder I’ve included the following files:
cpufreq.h
img0_128x64c1.h
img1_128x64c1.h