Characteristic | Locus |
---|---|
Inheritance | object > Ht16k33 |
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.ICs.IOExpanders |
Assembly | Ht16k33.dll |
Syntax
public class Ht16k33 : II2cPeripheral
Constructors
Ht16k33(II2cBus, byte)
Create a new HT16K33 object using the default parameters
Declaration
public Ht16k33(II2cBus i2cBus, byte address = 112)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | I2C bus instance |
byte | address | Address of the bus on the I2C display |
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
Declaration
protected readonly II2cCommunications i2cComms
Field Value
Type | Description |
---|---|
II2cCommunications |
Properties
DefaultI2cAddress
The default I2C address for the peripheral
Declaration
public byte DefaultI2cAddress { get; }
Property Value
Type | Description |
---|---|
byte |
Methods
ClearDisplay()
Clear the display
Declaration
public void ClearDisplay()
IsLedOn(int)
Is led at index on
Declaration
public bool IsLedOn(int ledIndex)
Parameters
Type | Name | Description |
---|---|---|
int | ledIndex | The led index |
Returns
Type | Description |
---|---|
bool | True if on |
Set14SegmentDisplay(char, int)
Set a single 14-segment display to a specific character
Declaration
public void Set14SegmentDisplay(char character, int displayIndex)
Parameters
Type | Name | Description |
---|---|---|
char | character | The ASCII character |
int | displayIndex | The display index (0-3) |
Set14SegmentMessage(string)
Set a message on a 14-segment display array
Declaration
public void Set14SegmentMessage(string message)
Parameters
Type | Name | Description |
---|---|---|
string | message | The message (up to 4 characters) |
SetBlinkRate(BlinkRate)
Set display blink rate
Declaration
public void SetBlinkRate(Ht16k33.BlinkRate blinkRate)
Parameters
Type | Name | Description |
---|---|---|
Ht16k33.BlinkRate | blinkRate | The blink rate as a byte |
SetBrightness(Brightness)
Set display brightness
Declaration
public void SetBrightness(Ht16k33.Brightness brightness)
Parameters
Type | Name | Description |
---|---|---|
Ht16k33.Brightness | brightness | The brightness |
SetDisplayOn(bool)
Set display on or off
Declaration
public void SetDisplayOn(bool isOn)
Parameters
Type | Name | Description |
---|---|---|
bool | isOn | On if true |
SetIsAwake(bool)
Set controller to awake / asleep
Declaration
public void SetIsAwake(bool awake)
Parameters
Type | Name | Description |
---|---|---|
bool | awake | Awake if true |
SetLed(byte, bool)
Set an individual led on or off
Declaration
public void SetLed(byte ledIndex, bool ledOn)
Parameters
Type | Name | Description |
---|---|---|
byte | ledIndex | The led index |
bool | ledOn | True for on |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Throws if the index is out of range |
ToggleLed(byte)
Toggle an led on or off
Declaration
public void ToggleLed(byte ledIndex)
Parameters
Type | Name | Description |
---|---|---|
byte | ledIndex | The led index |
UpdateDisplay()
Refresh the display
Declaration
public void UpdateDisplay()