Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Characteristic | Locus |
---|---|
Inheritance | object > Pca9633 |
Implements | II2cPeripheral |
Inherited Members | object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() |
Namespace | Meadow.Foundation.Leds |
Assembly | Pca9633.dll |
Syntax
public class Pca9633 : II2cPeripheral
Constructors
Pca9633(II2cBus, Addresses)
Create a new Pca9633 led controller object
Declaration
public Pca9633(II2cBus i2cBus, Pca9633.Addresses address = Addresses.Address_0x62)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | i2c bus |
Pca9633.Addresses | address | i2c address |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Pca9633(II2cBus, byte)
Create a new Pca9633 led controller object
Declaration
public Pca9633(II2cBus i2cBus, byte address)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | i2c bus |
byte | address | i2c address |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | 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
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Properties
DefaultI2cAddress
The default I2C address for the peripheral
Declaration
public byte DefaultI2cAddress { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
IsOn
Turn led controller output on or off
Declaration
public bool IsOn { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
LedBlue
Red LED location - used for RGB control
Declaration
public Pca9633.LedPosition LedBlue { get; set; }
Property Value
Type | Description |
---|---|
Pca9633.LedPosition |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
LedGreen
Red LED location - used for RGB control
Declaration
public Pca9633.LedPosition LedGreen { get; set; }
Property Value
Type | Description |
---|---|
Pca9633.LedPosition |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
LedRed
Red LED location - used for RGB control
Declaration
public Pca9633.LedPosition LedRed { get; set; }
Property Value
Type | Description |
---|---|
Pca9633.LedPosition |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Methods
SetAutoIncrementMode(AutoIncrement)
Set auto increment mode of control registers
Declaration
public void SetAutoIncrementMode(Pca9633.AutoIncrement mode)
Parameters
Type | Name | Description |
---|---|---|
Pca9633.AutoIncrement | mode |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetColor(Color)
Set RGB LED color if red, green and blue LEDs are set
Declaration
public void SetColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Color |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetDriveMode(DriveType)
Set the drive mode Open drain or totem pole
Declaration
public void SetDriveMode(Pca9633.DriveType drive)
Parameters
Type | Name | Description |
---|---|---|
Pca9633.DriveType | drive |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetGroupBrightess(byte)
Set brightness of all leds
Declaration
public void SetGroupBrightess(byte brightness)
Parameters
Type | Name | Description |
---|---|---|
byte | brightness | brightness (0-255) |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetLedBrightness(LedPosition, byte)
Set brightness of an individual led
Declaration
public void SetLedBrightness(Pca9633.LedPosition led, byte brightness)
Parameters
Type | Name | Description |
---|---|---|
Pca9633.LedPosition | led | led position |
byte | brightness | brightness (0-255) |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
SetRgbLedPositions(LedPosition, LedPosition, LedPosition)
Helper method to set RGB led positions for color control
Declaration
public void SetRgbLedPositions(Pca9633.LedPosition redLed, Pca9633.LedPosition greenLed, Pca9633.LedPosition blueLed)
Parameters
Type | Name | Description |
---|---|---|
Pca9633.LedPosition | redLed | red led position |
Pca9633.LedPosition | greenLed | green led position |
Pca9633.LedPosition | blueLed | blue led position |
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Sleep()
Put device into sleep state
Declaration
public void Sleep()
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |
Wake()
Put device into active state
Declaration
public void Wake()
Remarks
Pca9633 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Pca9633 pca9633;
public override Task Initialize()
{
Resolver.Log.Info("Initialize...");
pca9633 = new Pca9633(Device.CreateI2cBus());
return base.Initialize();
}
public override Task Run()
{
//set the location of R,G,B leds for color control
pca9633.SetRgbLedPositions(redLed: Pca9633.LedPosition.Led2,
greenLed: Pca9633.LedPosition.Led1,
blueLed: Pca9633.LedPosition.Led0);
//set a single color
pca9633.SetColor(Color.Red);
Thread.Sleep(1000);
pca9633.SetColor(Color.Blue);
Thread.Sleep(1000);
pca9633.SetColor(Color.Yellow);
return base.Run();
}
Sample project(s) available on GitHub
Wiring Example
To wire a Pca9633 to your Meadow board, connect the following:
Pca9633 | Meadow Pin |
---|---|
GND | GND |
VCC | 3V3 |
SCL | D08 (SCL Pin) |
SDA | D07 (SDA Pin) |