Skip to main content

Meadow.Foundation.Displays.Sh1107

Sh1107
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Displays.Sh110x

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

Class Sh1107

Represents the Sh1107 family of displays (up to 128x128)

Assembly: Sh110x.dll
View Source
Declaration
public class Sh1107 : Sh110x, IPixelDisplay, IDisplay, ISpiPeripheral, II2cPeripheral, IDisposable

Inheritance: System.Object -> Meadow.Foundation.Displays.Sh110x

Implements:
Meadow.Peripherals.Displays.IPixelDisplay, Meadow.Peripherals.Displays.IDisplay, Meadow.Hardware.ISpiPeripheral, Meadow.Hardware.II2cPeripheral, System.IDisposable

Methods

Initialize()

Initialize the Sh1107

View Source
Declaration
protected override void Initialize()

SetDisplayOffsets(byte, byte)

This varies between manufacturers If the display is misaligned horizontally, try offset values like 0x00, 0x20, 0x40, etc. If the display is misaligned vertically, try offset values like 0x00, 0x20, 0x40, etc.

View Source
Declaration
public override void SetDisplayOffsets(byte startLine = 0, byte offset = 0)
Parameters
TypeNameDescription
System.BytestartLineLine number in display RAM to display at the top of the screen
System.ByteoffsetColumn number in display RAM to offset the screen

Implements

  • Meadow.Peripherals.Displays.IPixelDisplay
  • Meadow.Peripherals.Displays.IDisplay
  • Meadow.Hardware.ISpiPeripheral
  • Meadow.Hardware.II2cPeripheral
  • System.IDisposable