Class: Phidgets::TextLCD::TextLCDCustomCharacter

Inherits:
Object
  • Object
show all
Defined in:
lib/phidgets-ffi/text_lcd.rb

Overview

This class represents a custom character that are defined by a PhidgetTextLCD. All the properties of a custom character are stored and modified in this class.

Constant Summary collapse

Klass =
Phidgets::FFI::CPhidgetTextLCD

Instance Method Summary collapse

Instance Method Details

#set_custom_character(var1, var2) ⇒ Array<Integer>[2]

Sets a custom character, or raises an error. The custom character is defined by two integers. See the product manual for more information. example

lcd.custom_characters[0].set_custom_character(949247, 536)

Parameters:

  • first_value (Integer)

    first value given by the customchar utility

  • second_value (Integer)

    second value given by teh customchar utility

Returns:

  • (Array<Integer>[2])

    returns the custom character, or raises an error.



255
256
257
258
# File 'lib/phidgets-ffi/text_lcd.rb', line 255

def set_custom_character(var1, var2)
	  Klass.setCustomCharacter(@handle, @index + 8, var1, var2)
  [var1, var2]
end

#string_codeString

Returns the character code associated with the custom character, or raises an error.

example

lcd.screens[0].rows[0].display_string = "#{lcd.custom_characters[0].string_code}"

Returns:

  • (String)

    returns the character code associated with the custom character, or raises an error.



265
266
267
# File 'lib/phidgets-ffi/text_lcd.rb', line 265

def string_code
	eval('"' + "\\1#{@index}" + '"')  #ie, returns \10   - \17
end