Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Sep 13, 2023
1 parent 68b880b commit 8b7c9f8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Source/OLED128x32Wing/Driver/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,34 @@ The **Meadow.Foundation** peripherals library is an open-source repository of dr

For more information on developing for Meadow, visit [developer.wildernesslabs.co](http://developer.wildernesslabs.co/), to view all Wilderness Labs open-source projects, including samples, visit [github.com/wildernesslabs](https://github.com/wildernesslabs/)

## Usage

```
OLED128x32Wing oledWing;
MicroGraphics graphics;
public override Task Initialize()
{
Console.WriteLine("Initializing ...");
var i2cBus = Device.CreateI2cBus(I2cBusSpeed.FastPlus);
oledWing = new OLED128x32Wing(i2cBus, Device.Pins.D11, Device.Pins.D10, Device.Pins.D09);
graphics = new MicroGraphics(oledWing.Display);
graphics.CurrentFont = new Font12x16();
oledWing.ButtonA.Clicked += (sender, e) => UpdateDisplay("A pressed");
oledWing.ButtonB.Clicked += (sender, e) => UpdateDisplay("B pressed");
oledWing.ButtonC.Clicked += (sender, e) => UpdateDisplay("C pressed");
return Task.CompletedTask;
}
void UpdateDisplay(string message)
{
graphics.Clear();
graphics.DrawText(0, 8, message);
graphics.Show();
}
```

0 comments on commit 8b7c9f8

Please sign in to comment.