com.phidgets
Class TextLCDPhidget

java.lang.Object
  extended by com.phidgets.Phidget
      extended by com.phidgets.TextLCDPhidget

public final class TextLCDPhidget
extends Phidget

This class represents a Phidget Text LCD. All methods to control the Text LCD are implemented in this class.

The TextLCD Phidget consists of a Vacuum Fluorescent display that is capable of displaying Standard as well as custom characters in multiple rows.


Constructor Summary
TextLCDPhidget()
           
 
Method Summary
 boolean getBacklight()
          Returns the status of the backlight.
 int getColumnCount()
          Returns the number of columns (characters per row) available on the display.
 int getContrast()
          Returns the contrastof the display.
 boolean getCursor()
          Returns the status of the cursor.
 boolean getCursorBlink()
          Returns the status of the cursor blink.
 int getRowCount()
          Rwturns the number of rows available on the display.
 void setBacklight(boolean backlight)
          Sets the status of the backlight.
 void setContrast(int contrast)
          Sets the contrast of the display.
 void setCursor(boolean cursor)
          Sets the state of the cursor.
 void setCursorBlink(boolean cursorblink)
          Sets the state of the cursor blink.
 void setCustomCharacter(int index, int param1, int param2)
          Sets a custom character.
 void setDisplayString(int index, java.lang.String text)
          Sets the display string of a certain row.
 
Methods inherited from class com.phidgets.Phidget
addAttachListener, addDetachListener, addErrorListener, close, equals, getDeviceName, getDeviceType, getDeviceVersion, getLibraryVersion, getSerialNumber, getTag, isAttached, open, openAny, removeAttachListener, removeDetachListener, removeErrorListener, setTag, toString, waitForAttachment
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextLCDPhidget

public TextLCDPhidget()
               throws PhidgetException
Throws:
PhidgetException
Method Detail

getRowCount

public int getRowCount()
                throws PhidgetException
Rwturns the number of rows available on the display.

Returns:
Number of rows
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getColumnCount

public int getColumnCount()
                   throws PhidgetException
Returns the number of columns (characters per row) available on the display. This value is the same for every row.

Returns:
Number of columns
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getContrast

public int getContrast()
                throws PhidgetException
Returns the contrastof the display. This is the contrast of the entire display.

Returns:
Current contrast
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setContrast

public void setContrast(int contrast)
                 throws PhidgetException
Sets the contrast of the display. The valid range is 0-255. Changing the contrast can increase the readability of the display in certain viewing situation, such as at an odd angle.

Parameters:
contrast - New contrast to set
Throws:
PhidgetException - If this Phidget is not opened and attached, or the contrast value is out of range. See open for information on determining if a device is attached.

getBacklight

public boolean getBacklight()
                     throws PhidgetException
Returns the status of the backlight. True indicated that the backlight is on, False indicated that it is off. The backlight is by default turned on.

Returns:
Status of the backlight
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setBacklight

public void setBacklight(boolean backlight)
                  throws PhidgetException
Sets the status of the backlight. True turns the backlight on, False turns it off. The backlight is by default turned on.

Parameters:
backlight - New backlight state
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getCursor

public boolean getCursor()
                  throws PhidgetException
Returns the status of the cursor. True turns the cursor is on, False turns it 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.

Returns:
Status of the cursor
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setCursor

public void setCursor(boolean cursor)
               throws PhidgetException
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.

Parameters:
cursor - New cursor state
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getCursorBlink

public boolean getCursorBlink()
                       throws PhidgetException
Returns the status of the cursor blink. True turns the cursor blink on, False turns it 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.

Returns:
Status of the cursor blink
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setCursorBlink

public void setCursorBlink(boolean cursorblink)
                    throws PhidgetException
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.

Parameters:
cursorblink - New cursor blink state
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setDisplayString

public void setDisplayString(int index,
                             java.lang.String text)
                      throws PhidgetException
Sets the display string of a certain row. If the string is longer then the row, it will be truncated.

Parameters:
index - row
text - String
Throws:
PhidgetException - If this Phidget is not opened and attached, or if the row is invalid. See open for information on determining if a device is attached.

setCustomCharacter

public void setCustomCharacter(int index,
                               int param1,
                               int param2)
                        throws PhidgetException
Sets a custom character. You can set up to 8 custom characters, each one is completely defined by two integers, and gets stored in the character display until power is removed, whence they must be re-programmed. The characters lie in positions 8-15, and can be displayed by sending these codes to setDisplayString in amongst standard ASCII characters. See the TextLCD java example for more information.

Parameters:
index - position ( 8-15 )
param1 - first half of the character code
param2 - second half of the character code
Throws:
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.