Nicholas J Humfrey > Device-MatrixOrbital-GLK-0.01 > Device::MatrixOrbital::GLK

Download:
Device-MatrixOrbital-GLK-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Device::MatrixOrbital::GLK - Control the GLK series Matrix Orbital displays

SYNOPSIS ^

  use Device::MatrixOrbital::GLK;

  my $lcd = new Device::MatrixOrbital::GLK();

  $lcd->clear_screen();
  $lcd->print("Hello World!");

  $lcd->close();

DESCRIPTION ^

Device::MatrixOrbital::GLK is an object oriented perl module for controlling the GLK serial of LCD screens made by Matrix Orbital.

For more information about GLK series MatrixOrbital displays, please visit: http://www.matrixorbital.ca/products/glk_Series/

Please note that I am not an employee and have nothing to do with MatrixOrbital, other than being a happy customer.

METHODS ^

new( [$port], [$baudrate], [$lcdtype] )

Creates a new Device::MatrixOrbital::GLK object. All of the parametes are optional. The default port is '/dev/ttyS0', the default baud rate is 19200 and by default the LCD screen type will be detected automatically.

print( $string )

Display a string on the screen.

printf( $format, @params )

Display a formatted string on the screen.

backlight_on( $minutes )

This command turns the backlight on after the [minutes] timer has ex- pired, with a one-hundred minute maximum timer. A time of 0 specifies that the display should turn on immediately and stay on. When this com- mand is sent while the remember function is on, the timer will reset and begin after power up.

backlight_off()

This command turns the backlight off immediately. The backlight will remain off until a backlight_on() command has been received.

cursor_home()

This command moves the text insertion point to the top left of the display area, based on the current font metrics.

set_contrast( $contrast )

This command sets the display's contrast to $contrast, where $contrast is a value between 0 to 255. Lower values cause 'on' elements in the display area to appear lighter, while higher values cause 'on' elements to appear darker.

set_and_save_contrast( $contrast )

Like the set_contrast() method, only this command saves the $contrast value so that it is not lost after power down.

set_brightness( $brightness )

This command sets the backlight brightness according to $brightness.

set_and_save_brightness( $brightness )

Like the set_brightness() method, only this command saves the $brightness value so that it is not lost after power down.

set_autoscroll_on()

When auto scrolling is on, it causes the display to shift the entire display's contents up to make room for a new line of text when the text reaches the end of the scroll row defined in the font metrics (the bottom right character position).

set_autoscroll_off()

When auto scrolling is disabled, text will wrap to the top left corner of the display area when the text reaches the end of the scroll row defined in the font metrics (the bottom right character position). Existing text in the display area is not erased before new text is placed. A series of spaces followed by a cursor_home() command may be used to erase the top line of text.

set_drawing_color( $color )

This command sets the drawing color for subsequent graphic commands that do not have the drawing color passed as a parameter. The parameter $color is the value of the color where white is 0 and black is 1-255.

clear_screen()

This command clears the display and resets the text insertion position to the top left position of the screen defined in the font metrics.

draw_bitmap( $refid, $x, $y)

This command will draw a bitmap that is located in the on board memory. The bitmap is referenced by the bitmaps reference identification number, which is established when the bitmap is uploaded to the display module. The bitmap will be drawn beginning at the top left, from the specified X,Y coordinates.

draw_pixel( $x, $y)

This command will draw a pixel at $x, $y using the current drawing color.

draw_line( $x1, $y1, $x2, $y2)

This command will draw a line from $x1, $y1 to $x2, $y2 using the current drawing color. Lines may be drawn from any part of the display to any other part. However, it may be important to note that the line may in- terpolate differently right to left, or left to right. This means that a line drawn in white from right to left may not fully erase the same line drawn in black from left to right.

draw_line_continue( $x, $y)

This command will draw a line with the current drawing color from the last line end (x2,y2) to $x, $y. This command uses the global drawing color.

draw_rect( $x1, $y1, $x2, $y2)

This command draws a rectangular box in the specified color. The top left corner is specified by $x1, $y1 and the bottom right corner by $x2, $y2.

draw_solid_rect( $x1, $y1, $x2, $y2)

This command draws a solid rectangle in the specified color. The top left corner is specified by $x1, $y1 and the bottom right corner by $x2, $y2. Since this command involves considerable processing overhead, we strongly recommend the use of flow control, particularly if the command is to be repeated frequently.

get_lcd_type()

Returns the model of the LCD module that you are communicating with (for example 'GLK24064-25').

($width, $height) = get_lcd_dimensions()

Returns the dimensions (in pixels) of the LCD screen you are talking to as an array, width followed by height.

get_firmware_version()

Returns the firmware version of the LCD module that you are communicating with as a dotted integer (for example '5.4').

SEE ALSO ^

Manuals for the GLK and GLC Series of graphic LCD's:

http://www.matrixorbital.ca/manuals/GLK_series/

AUTHOR ^

Nicholas J Humfrey, njh@cpan.org

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 Nicholas J Humfrey

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.005 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: