Class: Phidgets::TextLCD::TextLCDCustomCharacter
- Inherits:
-
Object
- Object
- Phidgets::TextLCD::TextLCDCustomCharacter
- 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
-
#set_custom_character(var1, var2) ⇒ Array<Integer>[2]
Sets a custom character, or raises an error.
-
#string_code ⇒ String
Returns the character code associated with the custom character, or raises an error.
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)
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_code ⇒ String
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}"
265 266 267 |
# File 'lib/phidgets-ffi/text_lcd.rb', line 265 def string_code eval('"' + "\\1#{@index}" + '"') #ie, returns \10 - \17 end |