Home Elements Boards Recipes

Display SSD1306 Element

The DisplaySSD1306 Element allows connecting a pixel based OLED display based on a SSD1306 chip.

This OLED displays offer a mono color (e.g. white on black) output with various resolutions and can be addressed using the Wire / I2C or the SPI protocol.

This display implementation features supported by this adapter are:

Displays are availabe in several colors and also mixed colors. One pixel always has one color so these are not real color displays.

SSD1306 display

The implementation is done with the help of the GFX library for Arduino.

Web UI for the Display Element

sh1106 Web UI

This card shows the current output page that can also be seen on the local attached display. It is updated every time the status of the device is polled by the page.

Display Configuration

The display is configured using the following parameters:

width - The width of the display either characters or pixels.

height - The height of the display either characters or pixels.

rotation - Some displays can be rotated. The rotation of the display is given by values of 0, 90, 180 or 270.

page – The logical page that is displayed.

brightness – The displays an be adjusted in brightness / contrast by specifying a value using the brightness event in a range of 0 to 100. This has a limited range (limited by the chip).

busmode – This parameter specifies the bus type. Default is i2c.

I2C Configuration Example

The SSD1306 based displays can be connected to the SDA and SCL pins of the i2c bus that is configured in the device:

busmode – This parameter specifies the bus type and must be specified as i2c.

address - The i2c address of the display must be specified. Typical values are 0x3C and 0x3D.

busspeed – The bus speed used for the display can be specified up to 400KHz.

{
  "device": {
    "0": {
      ...
      "I2C-SDA": "D2",
      "I2C-SCL": "D1"
    }
  },
  "displayssd1306": {
    "0": {
      "title": "display",
      "description": "local display",
      "width": "128",
      "height": "64",
      "busmode": "i2c",
      "address": "0x3C",
      "busspeed": "400000",
      "brightness": "50"
    }
  }
}

See also

Tags

Element