Class: HelloArrayEeprom

Inherits:
ArduinoSketch show all
Defined in:
lib/examples/hello_array_eeprom.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



55
56
57
# File 'lib/examples/hello_array_eeprom.rb', line 55

def loop
   x = THROWAWAY
end

#setupObject



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
# File 'lib/examples/hello_array_eeprom.rb', line 27

def setup
  
  my_lcd.clearscr    "  I2C EEPROM Demo"
  my_lcd.setxy 0, 1, "block write and read"
  my_lcd.setxy 0, 2, "  back and display"
  my_lcd.setxy 0, 3, "    to the LCD"
  
  delay 2000
  
  my_lcd.clearscr    "  I2C EEPROM Demo?n    block write"

  mem0.write_page 0x0100, page_data, 20 

  delay 1000
  
  my_lcd.clearline 1, "  block readback"
  
  mem0.read_buffer 0x0100, in_buffer, 20 
  
  my_lcd.setxy 0, 2
  
  1.upto(20) do |x|
    my_lcd.print in_buffer[x-1]
    my_lcd.print " "
  end
  
end