Phidget TextLCD for Phidget
Modules with LCD displays (like the 1203)
This element allows you access
to a PhidgetTextLCD device, like the 1203. This element only
allows access to the LCD funtionality.
With this element, you can
access to the module directly (with the
serial number) or through the network, using the WebService of the
phidget's driver
in a remote computer with the phidget TextLCD
connected (here, you need the IP, port and password too).
Usage
To use any Phidget element,
drag an drop its icon to the list of
model elements of your model. Then, edit the connection parameters and
invoke phidget.connect()
in your code.
All methods returning a
boolean will return true
on
successful completion of the command, false
otherwise. Methods
returning a double value will return Double.NaN
if there is any
error when connecting to the phidget.
Available method for this
particular phidgets include:
- public boolean connect();
// establish the connection. Returns true if successful
- public int getRowCount();
//Returns the number of rows available on the display.
- public int
getColumnCount(); //Returns
the number of columns (characters per row) available on the
display.
- public boolean
setBacklight(boolean value);
//Sets the status of the backlight. The backlight is by default turned
on.
- public boolean
setBrightness(int value);
//Sets the brightness of the display. Changing the brightness can
increase the readability of the display in certain viewing situation,
such as at an odd angle. Not all TextLCDs support this method.
- public boolean
setContrast(int value);
//Sets the contrast of the display. Changing the contrast can increase
the readability of the display in certain viewing situation, such as at
an odd angle.
- public int getContrast();
//Returns the contrast of the display.
- public boolean
setCursor(boolean value);
//Sets the state of the cursor. True indicates that the cursor on,
False indicates that it is off. The cursor is an underscore which
appears directly to the right of the last entered character on the
display. The cursor is by default disabled.
- public boolean getCursor();
//Returns the status of the cursor.
- public boolean
setCursorBlink(boolean value);
//Sets the state of the cursor blink. True indicates that the cursor
blink is on, False indicates that it is off. The cursor blink is an
flashing box which appears directly to the right of the last entered
character on the display, in the same spot as the cursor if it is
enabled. The cursor blink is by default disabled.
- public boolean
getCursorBlink(); //Returns
the status of the cursor blink.
- public boolean
setDisplayString(int row, String str);
//Sets the display string of a certain row.
Example of use
// Init the module
myTextLCD.connect();
// Adjusting contrast, brightness, cursor and backlight
myTextLCD.setContrast(100);
myTextLCD.setBrightness(50);
myTextLCD.setCursor(true);
myTextLCD.setCursorBlink(true);
myTextLCD.setBacklight(true);
// a message
myTextLCD.setDisplayString(0, "Hello from EJS..."); // 0 -> first row