This blog is to add the OLED display on the nRF52 DK board. I would give the example code how to use the GFX and adafruit library on the Nordic nRF52.

On the Nordic nRF5 SDK, it contains the GFX library with the LCD 320×240.

https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_gfx.html

GFX library

The GFX library provides support for drawing graphic objects, as well as printing text.

Main features:

  • Support for drawing lines, rectangles, and circles.
  • Support for printing text on the screen.
  • Support for drawing bitmaps in RGB565 color format.
  • Hardware independent.
  • Any number of instances.

The library uses Bresenham’s algorithms for drawing objects. These are simple and efficient algorithms for drawing straight lines and circles on a grid of pixels.

For full API documentation of the library, see GFX Library.


However, if you need to add some small LCD display, it is hard to find any examples. For example, you can do the search the OLED LCD at the devzone.nordicsemi.com. The LCD is one of the hottest questions as below.

In this blog, I would use the SDK 15.3 and add the Solomon SSD1306 LCD to connect with nRF52 DK board. You can find all the source code at my github.

https://github.com/jimmywong2003/SSD1306-LCD-on-NRF52

It used the Nordic SDK 15.3 to connect two difference SSD1306 resolution displays through I2C interface.

  1. SSD1306 128×64
  2. SSD1306 128×32

There are two examples to run on SSD1306 (128×32 / 128×64) resolution with nRF52840 DK.
1) Port the Adafruit SSD1306 Library / GFX Library (refer to http://electronut.in/bluey/)
2) Port on the SSD1306 driver (refer to https://github.com/monpetit/nrf52-spi-i2c-master-ssd1306)