nanoFramework.Iot.Device.Ssd13xx 1.2.158

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Ssd13xx --version 1.2.158
NuGet\Install-Package nanoFramework.Iot.Device.Ssd13xx -Version 1.2.158
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Ssd13xx" Version="1.2.158" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.Ssd13xx --version 1.2.158
#r "nuget: nanoFramework.Iot.Device.Ssd13xx, 1.2.158"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install nanoFramework.Iot.Device.Ssd13xx as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Ssd13xx&version=1.2.158

// Install nanoFramework.Iot.Device.Ssd13xx as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Ssd13xx&version=1.2.158

SSD13xx & SSH1106 OLED display family

The SSD1306/SSH1106 are a single-chip CMOS OLED/PLED driver with controllers for organic/polymer light emitting diode dot-matrix graphic display system. It consists of 128 segments and 64 commons. This IC is designed for Common Cathode type OLED panel.

Documentation

Board

Connection schematics

Binding Notes

This binding currently only supports commands and raw data. Eventually, the plan is to create a graphics library that can send text and images to the device. So this library is just a start and you'll find in the sample more advance commands.

The following connection types are supported by this binding.

  • I2C
  • SPI

Usage notes

There are two groups of drawing methods.

  1. Various specialized drawing methods allowing to draw on screen pixel-by-pixel, like:

    • DrawPixel(...): draws one pixel
    • DrawHorizontalLine(...): draws a horizontal line
    • DrawVerticalLine(...): draws a vertical line
    • DrawFilledRectangle(...): draws a filled rectangle
    • DrawBitmap(...): draws a bitmap
    • DrawString(...): draws a string with preset font

    Using these methods you do not need to care about any technique the driver uses to display your drawing instructions.

  2. Methods allowing to modify screen content by blocks of internal representation (screen buffer), like:

    • DrawDirectAligned(...): overwrites screen buffer with given content
    • ClearDirectAligned(...): clears out (with 0x00) given part of screen buffer

    These methods allow faster (~100 times) display access but with some constraints.

    • bitmaps handed over here must be in appropriate format (see SSD13xx docs for "GDDRAM" and "Horizontal addressing mode").
    • no bit operations occure with existing buffer data (with pixels drawn via other means), the new data will overwrite the pixels "below" newly drawed content.
    • the "y" coordinate and the bitmap height must be byte aligned with screen buffer (again, see above docs)

The use of two groups can be freely mixed (e.g. display text via DrawString(...) and displaying an image below via DrawDirectAligned(...))

Examples for 1. can be found in samples folder.

Example for 2. follows here.

// There are superb online helpers like the one below which are able to
// create an appropriate byte array from an image in code use ready format.
// https://www.mischianti.org/images-to-byte-array-online-converter-cpp-arduino/
// On the site above use these settings to get bytes needed here:
// - "plain bytes"
// - "vertical - 1 bit per pixel"
var buffer = new byte[] { ... }; 
var width = 16;
var height = 16;

// instantiation example
var ssd1306 = new Ssd1306(
    I2cDevice.Create(
        new I2cConnectionSettings(
            1, 
            Ssd1306.DefaultI2cAddress, 
            I2cBusSpeed.FastMode)), 
    Ssd13xx.DisplayResolution.OLED128x64);

// this line sends the image data to the screen
ssd1306.DrawDirectAligned(x, y, width, height, buffer);

// this one wipes its place to blank
ssd1306.ClearDirectAligned(x, y, width, height);

To display double byte fonts (for example fonts of Asian languages) you have to set the font to DoubleByteFont(), like this:

device.Font = new DoubleByteFont();
device.DrawString(2, 2, "功夫$", 2, false);
device.DrawString(2, 34, "89AB功夫$", 1, true);
device.Display();

Follows the output on the display:

double-byte.fonts

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on nanoFramework.Iot.Device.Ssd13xx:

Package Downloads
nanoFramework.MagicBit The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

This package includes nanoFramework.MagicBit, a board package library for MagicBit in .NET nanoFramework C# projects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.350 156 4/15/2024
1.3.328 198 3/22/2024
1.3.326 137 3/16/2024
1.3.250 511 11/10/2023
1.3.143 1,123 5/26/2023
1.3.130 251 5/16/2023
1.3.127 209 5/12/2023
1.3.122 125 5/11/2023
1.3.116 213 5/10/2023
1.3.111 196 5/3/2023
1.3.106 236 4/20/2023
1.3.87 667 3/17/2023
1.3.83 372 3/13/2023
1.3.26 1,466 1/5/2023
1.3.17 461 12/28/2022
1.2.158 872 11/13/2022
1.2.153 601 11/5/2022
1.2.141 1,599 10/25/2022
1.2.3 7,865 7/9/2022
1.1.113.2032 2,807 6/23/2022
1.1.58.10097 1,690 5/23/2022
1.1.1 569 4/14/2022
1.0.300 461 4/2/2022
1.0.288-preview.113 123 3/25/2022
1.0.288-preview.48 266 2/4/2022
1.0.288-preview.20 147 1/27/2022
1.0.281 496 1/17/2022
1.0.259 295 12/9/2021
1.0.212 333 10/13/2021
1.0.156 302 9/1/2021
1.0.155 320 8/31/2021
1.0.138 333 7/18/2021
1.0.136 348 7/17/2021
1.0.134 162 7/15/2021
1.0.133 173 7/14/2021
1.0.131 149 7/8/2021
1.0.130 179 7/6/2021
1.0.129 153 7/6/2021
1.0.125 185 7/5/2021
1.0.121 189 6/29/2021
1.0.120 174 6/29/2021
1.0.119 211 6/28/2021
1.0.118 199 6/20/2021
1.0.110 217 6/9/2021
1.0.109 148 6/8/2021
1.0.106 186 6/1/2021
1.0.104 243 5/29/2021
1.0.71 189 5/26/2021