Skip to main content

Class I2cCharacterDisplay

Represents a character display using I2C

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

Derived:
Meadow.Foundation.Displays.Lcd.GroveCharacterDisplay

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

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

DisplayConfig

The text display configuration

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

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
protected readonly II2cCommunications i2cComms

displayControl

Display control value

View Source
protected byte displayControl

displayMode

Display mode value

View Source
protected byte displayMode

backlightValue

Display backlight value

View Source
protected byte backlightValue

cursorLine

The cursor current line

View Source
protected byte cursorLine

cursorColumn

The cursor current column

View Source
protected byte cursorColumn

Methods

Initialize()

Initialize the display

View Source
protected virtual void Initialize()

Command(byte)

Send a command to the display

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

Send(byte, byte)

Send data to the display

View Source
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
public void ClearLine(byte lineNumber)
Parameters
TypeNameDescription
System.BytelineNumberThe line to clear (0 indexed)

ClearLines()

Clear all lines

View Source
public void ClearLines()

SetCursorPosition(byte, byte)

Set the cursor position

View Source
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
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
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
public virtual void DisplayOff()

DisplayOn()

Set the display on

View Source
public virtual void DisplayOn()

CursorOff()

Hide the cursor

View Source
public void CursorOff()

CursorOn()

Show the cursor

View Source
public void CursorOn()

BlinkCursor(bool)

Enable or disable cursor blinking

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

ScrollDisplayLeft()

Scroll the display left

View Source
public virtual void ScrollDisplayLeft()

ScrollDisplayRight()

Scroll the display right

View Source
public virtual void ScrollDisplayRight()

SetLeftToRight()

Set the display to show text left to right

View Source
public void SetLeftToRight()

SetRightToLeft()

Set the display to show text right to left

View Source
public void SetRightToLeft()

Autoscroll(bool)

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

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

SaveCustomCharacter(byte[], byte)

Save a custom character to the display

View Source
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
public void BacklightOn()

BacklightOff()

Turn the backlight off

View Source
public void BacklightOff()

IsBacklightOn()

Get the backlight state

View Source
public bool IsBacklightOn()
Returns

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

View Source
public void Show()

Implements