Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Characteristic | Locus |
---|---|
Inheritance | object > As1115 |
Implements | IGraphicsDisplay II2cPeripheral IDisposable |
Inherited Members | object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() |
Namespace | Meadow.Foundation.ICs.IOExpanders |
Assembly | As1115.dll |
Syntax
public class As1115 : IGraphicsDisplay, II2cPeripheral, IDisposable
Constructors
As1115(II2cBus, IPin, byte)
Create a new AS1115 object using the default parameters for
Declaration
public As1115(II2cBus i2cBus, IPin buttonInterruptPin, byte address = 0)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | I2cBus connected to display |
IPin | buttonInterruptPin | Interrupt pin |
byte | address | Address of the bus on the I2C display. |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
Declaration
protected readonly II2cCommunications i2cComms
Field Value
Type | Description |
---|---|
II2cCommunications |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Properties
ColorMode
The display color mode (1 bit per pixel)
Declaration
public ColorMode ColorMode { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
DecodeMode
The display decode mode BCD character / Hex character / Pixel
Declaration
public As1115.DecodeType DecodeMode { get; }
Property Value
Type | Description |
---|---|
As1115.DecodeType |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
DefaultI2cAddress
The default I2C address for the peripheral
Declaration
public byte DefaultI2cAddress { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Height
Display height in pixels for 8x8 matrix displays
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
IsDisposed
Is the peripheral disposed
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
KeyScanButtons
Readonly collection that contains all 16 key scan button objects
Declaration
public ReadOnlyDictionary<As1115.KeyScanButtonType, KeyScanButton>? KeyScanButtons { get; protected set; }
Property Value
Type | Description |
---|---|
ReadOnlyDictionary<As1115.KeyScanButtonType, KeyScanButton> |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
PixelBuffer
The buffer that holds the pixel data for 8x8 matrix displays
Declaration
public IPixelBuffer PixelBuffer { get; }
Property Value
Type | Description |
---|---|
IPixelBuffer |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SupportedColorModes
The Color mode supported by the display
Declaration
public ColorMode SupportedColorModes { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Width
Display width in pixels for 8x8 matrix displays
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Methods
Clear(bool)
Clear the display buffer
Declaration
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
bool | updateDisplay | If true, update the display |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Dispose(bool)
Dispose of the object
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Is disposing |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
DrawPixel(int, int, Color)
Draw a pixel at a given location
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | X position in pixels |
int | y | Y position in pixels |
Color | color | Color to draw - Black will turn pixels off, any color will turn pixels on |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
DrawPixel(int, int, bool)
Draw a pixel at a given location
Declaration
public void DrawPixel(int x, int y, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
int | x | X position in pixels |
int | y | Y position in pixels |
bool | enabled | If true, turn led on at location |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
EnableBlink(bool, bool)
Enable or disable display blinking
Declaration
public void EnableBlink(bool isEnabled, bool fastBlink = true)
Parameters
Type | Name | Description |
---|---|---|
bool | isEnabled | Display will blink if true |
bool | fastBlink | True for fast blink (period of 1s), False for slow blink (period of 2s) |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Fill(Color, bool)
Fill the display buffer with a color Black will clear the display, any other color will turn on all leds
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Color | fillColor | The color to fill |
bool | updateDisplay | Update the display |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Fill(int, int, int, int, Color)
Fill a region of the display buffer with a color Black will clear the display, any other color will turn on all leds
Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
Type | Name | Description |
---|---|---|
int | x | X position in pixels |
int | y | Y position in pixels |
int | width | Width in pixels |
int | height | Height in pixels |
Color | fillColor | Color to fill - Black will turn pixels off, any color will turn pixels on |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
GetButton(KeyScanButtonType)
Helper method to get IButton object references for keyscan buttons
Declaration
public IButton GetButton(As1115.KeyScanButtonType buttonType)
Parameters
Type | Name | Description |
---|---|---|
As1115.KeyScanButtonType | buttonType | The button type |
Returns
Type | Description |
---|---|
IButton | The button object reference |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
InvertPixel(int, int)
Invert pixel at location (switch on/off)
Declaration
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | X position in pixels |
int | y | Y position in pixels |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetCharacter(BcdCharacterType, int, bool)
Set a single character
Declaration
public void SetCharacter(As1115.BcdCharacterType character, int digit, bool showDecimal = false)
Parameters
Type | Name | Description |
---|---|---|
As1115.BcdCharacterType | character | the character to display |
int | digit | the digit index starting from the left |
bool | showDecimal | show the decimal with the character |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetCharacter(HexCharacterType, int, bool)
Set a single character
Declaration
public void SetCharacter(As1115.HexCharacterType character, int digit, bool showDecimal = false)
Parameters
Type | Name | Description |
---|---|---|
As1115.HexCharacterType | character | the character to display |
int | digit | the digit index starting from the left |
bool | showDecimal | show the decimal with the character |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetIntensity(byte)
Set display intensity (0-15)
Declaration
public void SetIntensity(byte intensity)
Parameters
Type | Name | Description |
---|---|---|
byte | intensity | Intensity from 0-15 (clamps above 15) |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetNumber(int)
Set number to display (left aligned)
Declaration
public void SetNumber(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | the number to display |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
Show()
Update the display
Declaration
public void Show()
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Show(int, int, int, int)
Update the display from the display buffer
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
int | left | |
int | top | |
int | right | |
int | bottom |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
TestMode(bool)
Enable/disable test mode
Declaration
public void TestMode(bool testOn)
Parameters
Type | Name | Description |
---|---|---|
bool | testOn | True to enable, false to disable |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
WriteBuffer(int, int, IPixelBuffer)
Write a pixel buffer to the display buffer
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
int | x | X position in pixels |
int | y | Y position in pixels |
IPixelBuffer | displayBuffer | Display buffer to write |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Events
KeyScanPressEnded
Event raised when any key scan button is released
Declaration
public event EventHandler<KeyScanEventArgs> KeyScanPressEnded
Event Type
Type | Description |
---|---|
EventHandler<KeyScanEventArgs> |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
KeyScanPressStarted
Event raised when any key scan button is pressed
Declaration
public event EventHandler<KeyScanEventArgs> KeyScanPressStarted
Event Type
Type | Description |
---|---|
EventHandler<KeyScanEventArgs> |
Remarks
As1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
As1115 as1115;
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
as1115 = new As1115(Device.CreateI2cBus(), Device.Pins.D03);
//general key scan events - will raise for all buttons
as1115.KeyScanPressStarted += KeyScanPressStarted;
//or access buttons as IButtons individually
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClickedThreshold = TimeSpan.FromSeconds(1);
as1115.KeyScanButtons[KeyScanButtonType.Button1].Clicked += Button1_Clicked;
as1115.KeyScanButtons[KeyScanButtonType.Button1].LongClicked += Button1_LongClicked; ;
graphics = new MicroGraphics(as1115);
return base.Initialize();
}
private void Button1_LongClicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 long press");
}
private void Button1_Clicked(object sender, EventArgs e)
{
Resolver.Log.Info("Button 1 clicked");
}
private void KeyScanPressStarted(object sender, KeyScanEventArgs e)
{
Resolver.Log.Info($"{e.Button} pressed");
}
public override Task Run()
{
graphics.Clear();
graphics.DrawLine(0, 0, 7, 7, true);
graphics.DrawLine(0, 7, 7, 0, true);
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Ads1115 to your Meadow board, connect the following:
Ads1115 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |