C# Class 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.
Mostrar archivo Open project: cyrusbuilt/MonoPi Class Usage Examples

Public Methods

Method Description
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.

Protected Methods

Method Description
UpdateDisplayControl ( ) : void

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

Method Details

Begin() public method

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. ///
return void

Begin() public method

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. ///
return void

Clear() public method

Clears the LCD screen and positions the cursor in the upper-left corner of the display.
public Clear ( ) : void
return void

CreateChar() public method

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. ///
return void

CreateChar() public method

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. ///
return void

LcdModule() public method

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. ///
return System

MoveCursor() public method

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. ///
return void

ReturnHome() public method

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
return void

ScrollDisplayLeft() public method

Scrolls the contents of the display (text and cursor) one space to the left.
public ScrollDisplayLeft ( ) : void
return void

ScrollDisplayRight() public method

Scrolls the contents of the display (text and cursor) one space to the right.
public ScrollDisplayRight ( ) : void
return void

SendCommand() public method

Sends HD44780 LCD interface command.
/// is not specified. ///
public SendCommand ( Byte data ) : void
data Byte /// The byte command to send. ///
return void

SetCursorPosition() public method

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. ///
return void

UpdateDisplayControl() protected method

Updates the display control. This method is called when any of the display properties are changed.
protected UpdateDisplayControl ( ) : void
return void

Write() public method

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. ///
return void

Write() public method

Writes text to the LCD.
public Write ( String text ) : void
text String /// The text to display. ///
return void

WriteByte() public method

Sends one data byte to the display.
/// is not specified. ///
public WriteByte ( Byte data ) : void
data Byte /// Data. ///
return void