We are updating the previous post on drawing text, since we realized we needed to fix a major display bug in pixel locating the text. In addition to that we updated the API for drawing text to return a bounding box around the drawn text so that the developer can know the pixel coordinates of where the text was drawn in the framebuffer. We also updated the bit-dump API to optionally add color to the terminal output.Read More →
In an earlier post we had discussed the framebuffer object of the C library for performing graphics on the OLED screen SSD1306 using a Raspberry Pi. We also discussed how to draw text using FreeType2.
In this post we show you how to draw straight lines on the OLED screen using our
In the previous post we had discussed the framebuffer object of the C library for performing graphics on the OLED screen SSD1306 using a Raspberry Pi.
In this blog post, we demonstrate how we have used FreeType2 to draw
text on the screen using fonts that can be installed using your Raspbian distro
packages. FreeType2 provides an easy way to render any type of supported font on
the screen, and we encapsulate all of that in a single function call
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 https://learn.adafruit.com/monochrome-oled-breakouts/python-usage-2.
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 →