All posts tagged i2c

C Library for Display on OLED Chip SSD1306

We purchased a 128x32 pixel OLED screen model SSD1306 from DIYMall via Amazon to display live information on a Raspberry Pi, that we had been using for debugging a product. The requirement for a Raspberry Pi to have an HDMI screen to see live outputs on say a GPIO or SPI pin is too cumbersome, especially when you are not in your lab environment with a TV or HDMI compatible monitor lying around.

With this in mind we purchased the OLED screen that works using I2C pins on the Raspberry Pi. If your task is simple and one-off we recommend using CircuitPython or MicroPython with the Adafruit SSD1306 library. More help on this can be found at

However, we wanted to write our own library for writing to the SSD1306 OLED chip directly in C, as eventually this would be used in our internal product tools and help with longer battery life. We tested the Adafruit library and it used more CPU than expected.

Read More →