Remarks

Sh1107
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Sh1106

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    var sh1107 = new Sh1107
    (
        i2cBus: Device.CreateI2cBus(),
        address: (byte)Addresses.Address_0x3C,
        width: 128,
        height: 128
    );

    graphics = new MicroGraphics(sh1107)
    {
        CurrentFont = new Font12x16(),
        Rotation = RotationType._180Degrees
    };

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "SH1107");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Characteristic Locus
Inheritance object Sh110x > Sh1107
Implements IGraphicsDisplay ISpiPeripheral II2cPeripheral IDisposable
Inherited Members Sh110x.ColorMode Sh110x.SupportedColorModes Sh110x.Width Sh110x.Height Sh110x.DefaultSpiBusSpeed Sh110x.SpiBusSpeed Sh110x.DefaultSpiBusMode Sh110x.SpiBusMode Sh110x.DefaultI2cAddress Sh110x.connectionType Sh110x.PixelBuffer Sh110x.IsDisposed Sh110x.i2cComms Sh110x.spiComms Sh110x.commandBuffer Sh110x.SetDisplayOffset(byte) Sh110x.InvertDisplay(bool) Sh110x.PowerSaveMode() Sh110x.Reset() Sh110x.SetContrast(byte) Sh110x.Show() Sh110x.Show(int, int, int, int) Sh110x.Clear(bool) Sh110x.DrawPixel(int, int, Color) Sh110x.DrawPixel(int, int, bool) Sh110x.InvertPixel(int, int) Sh110x.StartScrolling(Sh110x.ScrollDirection) Sh110x.StartScrolling(Sh110x.ScrollDirection, byte, byte) Sh110x.StopScrolling() Sh110x.Fill(Color, bool) Sh110x.Fill(int, int, int, int, Color) Sh110x.WriteBuffer(int, int, IPixelBuffer) Sh110x.Dispose() Sh110x.Dispose(bool) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Displays
Assembly Sh110x.dll

Syntax

public class Sh1107 : Sh110x, IGraphicsDisplay, ISpiPeripheral, II2cPeripheral, IDisposable

Constructors

Sh1107(II2cBus, byte, int, int)

Create a new Sh1107 object

Declaration
public Sh1107(II2cBus i2cBus, byte address, int width = 128, int height = 128)

Parameters

Type Name Description
II2cBus i2cBus

I2C bus connected to display

byte address

I2C address

int width

Display width in pixels

int height

Display height in pixels

Remarks

Sh1107
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Sh1106

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    var sh1107 = new Sh1107
    (
        i2cBus: Device.CreateI2cBus(),
        address: (byte)Addresses.Address_0x3C,
        width: 128,
        height: 128
    );

    graphics = new MicroGraphics(sh1107)
    {
        CurrentFont = new Font12x16(),
        Rotation = RotationType._180Degrees
    };

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "SH1107");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Sh1107(ISpiBus, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, int, int)

Create a new Sh1107 display object

Declaration
public Sh1107(ISpiBus spiBus, IDigitalOutputPort chipSelectPort, IDigitalOutputPort dataCommandPort, IDigitalOutputPort resetPort, int width = 128, int height = 128)

Parameters

Type Name Description
ISpiBus spiBus

SPI bus connected to display

IDigitalOutputPort chipSelectPort

Chip select output port

IDigitalOutputPort dataCommandPort

Data command output port

IDigitalOutputPort resetPort

Reset output port

int width

Display width in pixels

int height

Display height in pixels

Remarks

Sh1107
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Sh1106

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    var sh1107 = new Sh1107
    (
        i2cBus: Device.CreateI2cBus(),
        address: (byte)Addresses.Address_0x3C,
        width: 128,
        height: 128
    );

    graphics = new MicroGraphics(sh1107)
    {
        CurrentFont = new Font12x16(),
        Rotation = RotationType._180Degrees
    };

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "SH1107");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Sh1107(ISpiBus, IPin, IPin, IPin, int, int)

Create a new Sh1107 object

Declaration
public Sh1107(ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, int width = 128, int height = 128)

Parameters

Type Name Description
ISpiBus spiBus

SPI bus connected to display

IPin chipSelectPin

Chip select pin

IPin dcPin

Data command pin

IPin resetPin

Reset pin

int width

Display width in pixels

int height

Display height in pixels

Remarks

Sh1107
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Sh1106

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    var sh1107 = new Sh1107
    (
        i2cBus: Device.CreateI2cBus(),
        address: (byte)Addresses.Address_0x3C,
        width: 128,
        height: 128
    );

    graphics = new MicroGraphics(sh1107)
    {
        CurrentFont = new Font12x16(),
        Rotation = RotationType._180Degrees
    };

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "SH1107");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Methods

Initialize()

Initialize the Sh1107

Declaration
protected override void Initialize()

Overrides

Remarks

Sh1107
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Sh1106

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    var sh1107 = new Sh1107
    (
        i2cBus: Device.CreateI2cBus(),
        address: (byte)Addresses.Address_0x3C,
        width: 128,
        height: 128
    );

    graphics = new MicroGraphics(sh1107)
    {
        CurrentFont = new Font12x16(),
        Rotation = RotationType._180Degrees
    };

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "SH1107");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub