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
ICharacterLcdInterface to the display
culture
stringUser culture
Properties
Culture
Returns the active culture.
public string Culture { get; }
Property Value
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
stringText to display
scrollSpeed
TimeSpanSpeed between scroll steps (one step being one display cell width)
cancellationToken
CancellationTokenToken for cancelling the operation
DisplayTime(DateTime, string)
Display the current time
public void DisplayTime(DateTime dateTime, string format = "t")
Parameters
dateTime
DateTimeTime to display
format
stringTime 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
stringPre-formatted value to print
unitText
stringUnit 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
stringName of the character Rom, required to properly print culture-specific characters in the small text display
factory
LcdCharacterEncodingFactoryEncoding 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()