Class Is31fl3731
Represents the IS31FL3731 IC The Is31fl3731 is a compact LED driver for 144 single LEDs
Assembly: Is31fl3731.dll
View Source
public class Is31fl3731 : II2cPeripheral
Implements:
Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Frame
The current frame
View Source
public byte Frame { get; }
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
View Source
protected readonly II2cCommunications i2cComms
Methods
Initialize()
Initialize the IS31FL3731 by shutting it down, turning it back on and setting it to Picture mode.
View Source
public void Initialize()
SetLedState(bool)
Set the LED state for all LED's in the current Frame
View Source
public virtual void SetLedState(bool on)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | on | true = on, false = off |
SetLedState(byte, bool)
Sets the state for all LEDs for the specified frame
View Source
public virtual void SetLedState(byte frame, bool on)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | |
System.Boolean | on | true = on, false = off |
WriteRegister(byte, byte)
Write to the current frame register
View Source
protected virtual void WriteRegister(byte register, byte data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | register | Register to write to |
System.Byte | data | The data value |
WriteRegister(byte, byte, byte)
Write a value to a register
View Source
protected virtual void WriteRegister(byte frame, byte register, byte data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | The frame |
System.Byte | register | Register to write to |
System.Byte | data | The data value |
SetBlinkMode(bool, byte)
Enable/disable blink mode
View Source
public virtual void SetBlinkMode(bool enabled, byte period)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | true = on, false = off |
System.Byte | period | the blink duration |
Clear()
Turn off all LEDs for the specified frame
View Source
public virtual void Clear()
Clear(byte)
Turn off all LEDs for the specified frame
View Source
public virtual void Clear(byte frame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | the frame to clear |
ClearAllFrames()
Turn off all LEDs
View Source
public virtual void ClearAllFrames()
SetLedPwm(byte, byte)
Set the PWM value for the specified LED
View Source
public virtual void SetLedPwm(byte ledIndex, byte pwm)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | ledIndex | The LED number |
System.Byte | pwm | The pwm value 0-255 |
SetLedPwm(byte, byte, byte)
Set the PWM value for the specified LED
View Source
public virtual void SetLedPwm(byte frame, byte ledIndex, byte brightness)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | Frame number. 0-7 |
System.Byte | ledIndex | The LED number. 0-144 |
System.Byte | brightness | The pwm value 0-255 |
DisplayFrame(byte)
Display the specified frame
View Source
public virtual void DisplayFrame(byte frame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | The frame number. 0-7 |
SetFrame(byte)
Sets the current frame.
View Source
public virtual void SetFrame(byte frame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | The frame number. 0-7 |
SetBlinkFunctionOnAllLeds(bool)
Blink all LEDs for the current frame. Blink Mode muse be enabled
View Source
public virtual void SetBlinkFunctionOnAllLeds(bool on)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | on | true = on, false = off |
SetBlinkFunctionOnAllLeds(byte, bool)
Blink all the LEDs for the specified frame
View Source
public virtual void SetBlinkFunctionOnAllLeds(byte frame, bool on)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | frame # |
System.Boolean | on | true = on, false = off |
SelectPage(byte)
Select the page/frame
View Source
protected virtual void SelectPage(byte page)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | page | page/frame # |
Implements
Meadow.Hardware.II2cPeripheral