Remarks

SSD1306
Status
Source code GitHub
NuGet package

The SSD1309 is a display controller used to control small, low resolution, single color OLED displays. OLED displays generate their own light - no backlight is included or required.

SSD1309 displays can be found supporting both I2C and SPI and come in resolutions of 32x128, 64x128, 16x96 and 64x96.

You may find mutlicolor variants, however, the color is achieved by placing one or more color filter over the single color display.

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    GraphicsLibrary graphics;
    Ssd1309 display;

    public MeadowApp()
    {
        CreateSpiDisplay();
        //CreateI2CDisplay();

        display.Clear(true);

        Console.WriteLine("Create Graphics Library");
        TestDisplayGraphicsAPI();
    }

    void CreateSpiDisplay()
    {
        Console.WriteLine("Create Display with SPI...");

        var config = new Meadow.Hardware.SpiClockConfiguration(12000, Meadow.Hardware.SpiClockConfiguration.Mode.Mode0);

        var bus = Device.CreateSpiBus(Device.Pins.SCK, Device.Pins.MOSI, Device.Pins.MISO, config);

        display = new Ssd1309
        (
            device: Device,
            spiBus: bus,
            chipSelectPin: Device.Pins.D02,
            dcPin: Device.Pins.D01,
            resetPin: Device.Pins.D00
        );
    }

    void CreateI2CDisplay()
    {
        Console.WriteLine("Create Display with I2C...");

        display = new Ssd1309
        (
            i2cBus: Device.CreateI2cBus(),
            address: 60
        );
    }

    void TestDisplayGraphicsAPI()
    {
        graphics = new GraphicsLibrary(display);

        graphics.Clear();
        graphics.CurrentFont = new Font12x16();
        graphics.DrawText(0, 0, "MeadowB3.7");
        graphics.DrawText(0, 24, "4-8x faster");
        graphics.DrawText(0, 48, "86x IO perf");

        graphics.Show();
    }
}

Sample projects available on GitHub

Wiring Example

To wire a Ssd1309 to your Meadow board using I2C, connect the following:

Ssd1309 Meadow Pin
GND GND
VCC 3V3
SCL D08 (SCL Pin)
SDA D07 (SDA Pin)

The OLED displays are available with a SPI or I2C interfaces. Wiring for the I2C interface is as follows:

Characteristic Locus
Inheritance System.Object Ssd1306 > Ssd1309
Inherited Members Ssd1306.ColorMode Ssd1306.Width Ssd1306.Height Ssd1306.spiPeripheral Ssd1306.spi Ssd1306.dataCommandPort Ssd1306.resetPort Ssd1306.chipSelectPort Ssd1306.connectionType Ssd1306.Data Ssd1306.Command Ssd1306.InvertDisplay Ssd1306.Contrast Ssd1306.Sleep Ssd1306.Show() Ssd1306.Clear(Boolean) Ssd1306.SetPenColor(Color) Ssd1306.DrawPixel(Int32, Int32) Ssd1306.DrawPixel(Int32, Int32, Color) Ssd1306.DrawPixel(Int32, Int32, Boolean) Ssd1306.StartScrolling(Ssd1306.ScrollDirection) Ssd1306.StartScrolling(Ssd1306.ScrollDirection, Byte, Byte) Ssd1306.StopScrolling()
Namespace Meadow.Foundation.Displays
Assembly Ssd1306.dll

Syntax

public class Ssd1309 : Ssd1306

Constructors

Ssd1309(II2cBus, Byte)

Create a new SSD1309 object using the default parameters for

Declaration
public Ssd1309(II2cBus i2cBus, byte address = 60)

Parameters

Type Name Description
II2cBus i2cBus
System.Byte address

Address of the bus on the I2C display.

Remarks

Note that by default, any pixels out of bounds will throw and exception. This can be changed by setting the property to true.

Ssd1309(IIODevice, ISpiBus, IPin, IPin, IPin)

Create a new SSD1306 object using the default parameters for

Declaration
public Ssd1309(IIODevice device, ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin)

Parameters

Type Name Description
IIODevice device
ISpiBus spiBus
IPin chipSelectPin
IPin dcPin
IPin resetPin

Remarks

Note that by default, any pixels out of bounds will throw and exception. This can be changed by setting the property to true.