C# Класс CyrusBuilt.MonoPi.LCD.LcdModule

Hitachi HD44780-based LCD module control class, largely derived from: Micro Liquid Crystal Library http://microliquidcrystal.codeplex.com Appache License Version 2.0 This classes uses the ILcdTransferProvider to provide an interface between the Raspberry Pi and the LCD module via GPIO.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Begin ( Int32 columns, Int32 lines ) : void

Initializes the LCD. Specifies dimensions (width and height) of the display.

Begin ( Int32 columns, Int32 lines, System.Boolean leftToRight, System.Boolean dotSize ) : void

Initializes the LCD. Specifies dimensions (width and height) of the display.

Clear ( ) : void

Clears the LCD screen and positions the cursor in the upper-left corner of the display.

CreateChar ( Int32 location, Byte charmap ) : void

Creates a custom character (glyph) for use on the LCD.

Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, call WriteByte and pass its number.

CreateChar ( Int32 location, Byte charmap, Int32 offset ) : void

Creates a custom character (glyph) for use on the LCD.

Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, call WriteByte and pass its number.

LcdModule ( ILcdTransferProvider provider ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.LCD.LcdModule class with the LCD transfer provider.

MoveCursor ( System.Boolean right ) : void

Moves the cursor left or right.

ReturnHome ( ) : void

Positions the cursor in the upper-left of the LCD (home position). That is, use that location in outputting subsequent text to the display. To also clear the display, use the Clear() method instead.

ScrollDisplayLeft ( ) : void

Scrolls the contents of the display (text and cursor) one space to the left.

ScrollDisplayRight ( ) : void

Scrolls the contents of the display (text and cursor) one space to the right.

SendCommand ( Byte data ) : void

Sends HD44780 LCD interface command.

SetCursorPosition ( Int32 column, Int32 row ) : void

Position the LCD cursor; that is, set the location at which subsequent text written to the LCD will be displayed.

Write ( Byte buffer, Int32 offset, Int32 count ) : void

Writes a specified number of bytes to the LCD using data from a buffer.

Write ( String text ) : void

Writes text to the LCD.

WriteByte ( Byte data ) : void

Sends one data byte to the display.

Защищенные методы

Метод Описание
UpdateDisplayControl ( ) : void

Updates the display control. This method is called when any of the display properties are changed.

Описание методов

Begin() публичный Метод

Initializes the LCD. Specifies dimensions (width and height) of the display.
public Begin ( Int32 columns, Int32 lines ) : void
columns System.Int32 /// The number of columns that the display has. ///
lines System.Int32 /// The number of rows the display has. ///
Результат void

Begin() публичный Метод

Initializes the LCD. Specifies dimensions (width and height) of the display.
public Begin ( Int32 columns, Int32 lines, System.Boolean leftToRight, System.Boolean dotSize ) : void
columns System.Int32 /// The number of columns that the display has. ///
lines System.Int32 /// The number of rows the display has. ///
leftToRight System.Boolean /// If set to true left to right, versus right to left. ///
dotSize System.Boolean /// If set true and only one line set, then the font size will /// be set 10px high. ///
Результат void

Clear() публичный Метод

Clears the LCD screen and positions the cursor in the upper-left corner of the display.
public Clear ( ) : void
Результат void

CreateChar() публичный Метод

Creates a custom character (glyph) for use on the LCD.
Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, call WriteByte and pass its number.
public CreateChar ( Int32 location, Byte charmap ) : void
location System.Int32 /// Which character to create (0 - 7). ///
charmap Byte /// The character's pixel data. ///
Результат void

CreateChar() публичный Метод

Creates a custom character (glyph) for use on the LCD.
Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, call WriteByte and pass its number.
public CreateChar ( Int32 location, Byte charmap, Int32 offset ) : void
location System.Int32 /// Which character to create (0 - 7). ///
charmap Byte /// The character's pixel data. ///
offset System.Int32 /// Offset in the charmap where character data is found. ///
Результат void

LcdModule() публичный Метод

Initializes a new instance of the CyrusBuilt.MonoPi.LCD.LcdModule class with the LCD transfer provider.
public LcdModule ( ILcdTransferProvider provider ) : System
provider ILcdTransferProvider /// The LCD transfer provider. ///
Результат System

MoveCursor() публичный Метод

Moves the cursor left or right.
public MoveCursor ( System.Boolean right ) : void
right System.Boolean /// If set to true, move the cursor right; Otherwise, left. ///
Результат void

ReturnHome() публичный Метод

Positions the cursor in the upper-left of the LCD (home position). That is, use that location in outputting subsequent text to the display. To also clear the display, use the Clear() method instead.
public ReturnHome ( ) : void
Результат void

ScrollDisplayLeft() публичный Метод

Scrolls the contents of the display (text and cursor) one space to the left.
public ScrollDisplayLeft ( ) : void
Результат void

ScrollDisplayRight() публичный Метод

Scrolls the contents of the display (text and cursor) one space to the right.
public ScrollDisplayRight ( ) : void
Результат void

SendCommand() публичный Метод

Sends HD44780 LCD interface command.
/// is not specified. ///
public SendCommand ( Byte data ) : void
data Byte /// The byte command to send. ///
Результат void

SetCursorPosition() публичный Метод

Position the LCD cursor; that is, set the location at which subsequent text written to the LCD will be displayed.
public SetCursorPosition ( Int32 column, Int32 row ) : void
column System.Int32 /// The column position. ///
row System.Int32 /// The row position. ///
Результат void

UpdateDisplayControl() защищенный Метод

Updates the display control. This method is called when any of the display properties are changed.
protected UpdateDisplayControl ( ) : void
Результат void

Write() публичный Метод

Writes a specified number of bytes to the LCD using data from a buffer.
public Write ( Byte buffer, Int32 offset, Int32 count ) : void
buffer Byte /// The byte array containing data to write to the display. ///
offset System.Int32 /// The zero-base byte offset in the buffer at which to begin copying bytes /// to the display. ///
count System.Int32 /// The number of bytes to write. ///
Результат void

Write() публичный Метод

Writes text to the LCD.
public Write ( String text ) : void
text String /// The text to display. ///
Результат void

WriteByte() публичный Метод

Sends one data byte to the display.
/// is not specified. ///
public WriteByte ( Byte data ) : void
data Byte /// Data. ///
Результат void