Table of Contents

Class LcdValueUnitDisplay

Namespace
Iot.Device.CharacterLcd
Assembly
Iot.Device.CharacterLcd.dll

Displays a value and an unit in a big font on an LCD Display. Requires a display with at least 20x4 characters

public class LcdValueUnitDisplay
Inheritance
LcdValueUnitDisplay

Constructors

LcdValueUnitDisplay(ICharacterLcd, string)

Creates an instance of LcdValueUnitDisplay

public LcdValueUnitDisplay(ICharacterLcd lcd, string culture)

Parameters

lcd ICharacterLcd

Interface to the display

culture string

User culture

Properties

Culture

Returns the active culture.

public string Culture { get; }

Property Value

string

Methods

Clear()

Clears the display

public void Clear()

DisplayBigTextAsync(string, TimeSpan, CancellationToken)

Scrolls a text in big font trough the display

public void DisplayBigTextAsync(string text, TimeSpan scrollSpeed, CancellationToken cancellationToken)

Parameters

text string

Text to display

scrollSpeed TimeSpan

Speed between scroll steps (one step being one display cell width)

cancellationToken CancellationToken

Token for cancelling the operation

DisplayTime(DateTime, string)

Display the current time

public void DisplayTime(DateTime dateTime, string format = "t")

Parameters

dateTime DateTime

Time to display

format string

Time format specifier, default "t" (default short time format with hours and minutes and eventually AM/PM). Anything after the first space in the formatted string is printed as small text. This will for instance be AM/PM when the format specifier "T" is used, since only 6 chars (and two separators) fit on the display.

DisplayValue(string, string)

Display the given value/unit pair. The value must be pre-formatted with the required number of digits, ie. "2.01". The value should only contain one of ".", ":" or ",", or the printed result may be unexpected.

public void DisplayValue(string formattedValue, string unitText = "")

Parameters

formattedValue string

Pre-formatted value to print

unitText string

Unit or name of value. This is printed in normal small font on the bottom right corner of the display.

InitForRom(string, LcdCharacterEncodingFactory?)

Initializes the display for use as a big-number display. Configures the display with some graphic blocks for the display of big numbers.

public void InitForRom(string romName, LcdCharacterEncodingFactory? factory = null)

Parameters

romName string

Name of the character Rom, required to properly print culture-specific characters in the small text display

factory LcdCharacterEncodingFactory

Encoding factory or null

StopShowing()

Stop showing big characters. This method can be used to signal that the display will be used for different purposes. Before a Display method is used, InitForRom(string, LcdCharacterEncodingFactory?) needs to be called again. This clears the display.

public void StopShowing()