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.
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi 1 사용 예제들

공개 메소드들

메소드 설명
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