Skip to main content

Class I2cCharacterDisplay

Represents a character display using I2C

Assembly: CharacterDisplay.dll
View Source
Declaration
public class I2cCharacterDisplay : ICharacterDisplay, ITextDisplay, IDisplay, II2cPeripheral

Derived:
Meadow.Foundation.Displays.Lcd.GroveCharacterDisplay

Implements:
Meadow.Foundation.Displays.Lcd.ICharacterDisplay, Meadow.Peripherals.Displays.ITextDisplay, Meadow.Peripherals.Displays.IDisplay, Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

DisplayConfig

The text display configuration

View Source
Declaration
public TextDisplayConfig DisplayConfig { get; protected set; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

displayControl

Display control value

View Source
Declaration
protected byte displayControl

displayMode

Display mode value

View Source
Declaration
protected byte displayMode

backlightValue

Display backlight value

View Source
Declaration
protected byte backlightValue

cursorLine

The cursor current line

View Source
Declaration
protected byte cursorLine

cursorColumn

The cursor current column

View Source
Declaration
protected byte cursorColumn

Methods

Initialize()

Initialize the display

View Source
Declaration
protected virtual void Initialize()

Command(byte)

Send a command to the display

View Source
Declaration
protected virtual void Command(byte value)
Parameters
TypeNameDescription
System.BytevalueThe command as a byte

Send(byte, byte)

Send data to the display

View Source
Declaration
protected virtual void Send(byte value, byte mode)
Parameters
TypeNameDescription
System.BytevalueThe data to send
System.BytemodeThe mode

ClearLine(byte)

Clear a line of text

View Source
Declaration
public void ClearLine(byte lineNumber)
Parameters
TypeNameDescription
System.BytelineNumberThe line to clear (0 indexed)

ClearLines()

Clear all lines

View Source
Declaration
public void ClearLines()

SetCursorPosition(byte, byte)

Set the cursor position

View Source
Declaration
public void SetCursorPosition(byte column, byte line)
Parameters
TypeNameDescription
System.BytecolumnThe cursor column
System.BytelineThe cursor line

Write(string)

Write a string to the display

View Source
Declaration
public void Write(string text)
Parameters
TypeNameDescription
System.StringtextThe text to show as a string

WriteLine(string, byte, bool)

Write text to a line on the display

View Source
Declaration
public void WriteLine(string text, byte lineNumber, bool showCursor = false)
Parameters
TypeNameDescription
System.StringtextThe text to show
System.BytelineNumberThe line number (0 index)
System.BooleanshowCursorShow the cursor if true

DisplayOff()

Set the display off

View Source
Declaration
public virtual void DisplayOff()

DisplayOn()

Set the display on

View Source
Declaration
public virtual void DisplayOn()

CursorOff()

Hide the cursor

View Source
Declaration
public void CursorOff()

CursorOn()

Show the cursor

View Source
Declaration
public void CursorOn()

BlinkCursor(bool)

Enable or disable cursor blinking

View Source
Declaration
public void BlinkCursor(bool blink)
Parameters
TypeNameDescription
System.BooleanblinkBlink if true

ScrollDisplayLeft()

Scroll the display left

View Source
Declaration
public virtual void ScrollDisplayLeft()

ScrollDisplayRight()

Scroll the display right

View Source
Declaration
public virtual void ScrollDisplayRight()

SetLeftToRight()

Set the display to show text left to right

View Source
Declaration
public void SetLeftToRight()

SetRightToLeft()

Set the display to show text right to left

View Source
Declaration
public void SetRightToLeft()

Autoscroll(bool)

Enable or disable auto scroll if the text length exceeds the display width

View Source
Declaration
public void Autoscroll(bool scroll)
Parameters
TypeNameDescription
System.BooleanscrollAuto scroll if true

SaveCustomCharacter(byte[], byte)

Save a custom character to the display

View Source
Declaration
public void SaveCustomCharacter(byte[] characterMap, byte address)
Parameters
TypeNameDescription
System.Byte[]characterMapThe character data
System.ByteaddressThe character address

BacklightOn()

Turn the backlight on

View Source
Declaration
public void BacklightOn()

BacklightOff()

Turn the backlight off

View Source
Declaration
public void BacklightOff()

IsBacklightOn()

Get the backlight state

View Source
Declaration
public bool IsBacklightOn()
Returns

System.Boolean: True if On, false if off### Show() Update the display

View Source
Declaration
public void Show()

Implements