Class: HelloLcdCharset

Inherits:
ArduinoSketch show all
Defined in:
lib/examples/hello_lcd_charset.rb

Instance Attribute Summary

Attributes inherited from ArduinoSketch

#pins

Instance Method Summary collapse

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

#loopObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/examples/hello_lcd_charset.rb', line 21

def loop
  
  myLCD.clearscr  "Alphabet Chars?n"
  0x41.upto(0x5a) do |i|    # A to Z
    @a = i                  # forces 'byte' typing to variable
    myLCD.print @a          # so print rouien prints character represented 
    delay 50                # by the index value
  end
  0x61.upto(0x7a) do |i|    # a to z
    @a = i
    myLCD.print @a
    delay 50
  end
  
  delay 3000
  myLCD.clearscr  "Numeric Chars?n"
  0x30.upto(0x39) do |i|    # 0 to 9
    @a = i
    myLCD.print @a
    delay 50
  end
  
  delay 3000

  myLCD.clearscr  "Other Chars?n"
  0x21.upto(0x2f) do |i|    # punctuation et al
    @a = i
    myLCD.print @a
    delay 50
  end
  0x3a.upto(0x40) do |i|
    @a = i
    myLCD.print @a
    delay 50
  end
  0x5b.upto(0x60) do |i|
    @a = i
    myLCD.print @a
    delay 50
  end
  0x7b.upto(0x7f) do |i|
    @a = i
    myLCD.print @a
    delay 50
  end
  
  delay 3000
    


end