Class: HelloPaLcd
- Inherits:
-
ArduinoSketch
- Object
- ArduinoSketch
- HelloPaLcd
- Defined in:
- lib/examples/hello_pa_lcd.rb
Instance Attribute Summary
Attributes inherited from ArduinoSketch
Instance Method Summary collapse
- #loop ⇒ Object
- #say_hello ⇒ Object
- #say_it_large ⇒ Object
-
#say_more ⇒ Object
passing print strings to home and setxy (also works on clearscr).
- #setup ⇒ Object
Methods inherited from ArduinoSketch
#add, add_to_setup, #array, #assembler, #comment_box, #compose_setup, #define, #delay, #digitalWrite, #formatted_print, #initialize, #input_pin, #input_pins, output_pin, #output_pin, post_process_ruby_to_c_methods, pre_process, #serial_begin
Methods included from ExternalVariableProcessing
#c_type, #check_variable_type, #post_process_arrays, #post_process_vars, #pre_process_vars, #process_external_vars, #translate_variables
Constructor Details
This class inherits a constructor from ArduinoSketch
Instance Method Details
#loop ⇒ Object
25 26 27 28 29 |
# File 'lib/examples/hello_pa_lcd.rb', line 25 def loop say_hello if .read_input say_more if .read_input say_it_large if .read_input end |
#say_hello ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/examples/hello_pa_lcd.rb', line 31 def say_hello @toggle = true my_lcd.clearscr "Any sufficiently advanced technology" my_lcd.setxy 0,2 my_lcd.setxy 0,3, "toggle state: " my_lcd.print @toggle end |
#say_it_large ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/examples/hello_pa_lcd.rb', line 47 def say_it_large my_lcd.intoBignum my_lcd.clearscr # line 0, col 0 1.upto(32) do |i| my_lcd.setxy 0,1 my_lcd.print i * i delay 200 end my_lcd.outofBignum end |
#say_more ⇒ Object
passing print strings to home and setxy (also works on clearscr)
39 40 41 42 43 44 |
# File 'lib/examples/hello_pa_lcd.rb', line 39 def say_more # passing print strings to home and setxy (also works on clearscr) @toggle = false my_lcd.clearscr "is indistinguishablefrom magic" my_lcd.setxy 0,3, "toggle state: " my_lcd.print @toggle end |
#setup ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/examples/hello_pa_lcd.rb', line 17 def setup delay 3000 my_lcd.setxy 0,0 my_lcd.print "Press button" my_lcd.setxy 0,1 my_lcd.print "One, two or three...." end |