class HelloLcdCharset

Public Instance Methods

loop() click to toggle source
# 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