Sha256: 197e0d95c5a4844491cec1a43496bf39ae537b46487d26c049be75cffc17673a

Contents?: true

Size: 974 Bytes

Versions: 23

Compression:

Stored size: 974 Bytes

Contents

class HelloArray < ArduinoSketch

 # still working this out...
 # for example, new instance style array declaration naming
 # is at odds with original style array naming  
 
 # for simple integer, string, float, and boolean arrays  
 @toppings = [1,2,3]
 @names = ["ciero", "bianca", "antica"]
 
 # when we just need to declare an array, or need more control, such as specific type requirements
 array "int ingredients[10]"
 array "int pizzas[] = {1,2,3,4}"
 
 output_pin 5, :as => :my_lcd, :device => :pa_lcd, :rate => 19200, :clear_screen => :true
 
 
 def loop
   
   my_lcd.clearscr "toppings: "
   delay 500
   
   @toppings.each do |a|
     my_lcd.print a
     my_lcd.print " "
     delay 500
   end
   
   my_lcd.setxy 0,1, "pizzas: "
   
   pizzas.each do |p|
     my_lcd.print p
     my_lcd.print " "
     delay 500
   end
   
   my_lcd.setxy 0,2, "names: "
   
   @names.each do |p|
     my_lcd.print p
     my_lcd.print " "
     delay 500
   end
   
   
 end

end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
neo_rad-0.4.0 lib/examples/hello_array.rb
atduskgreg-rad-0.2.5 lib/examples/hello_array.rb
atduskgreg-rad-0.3.0.1 lib/examples/hello_array.rb
atduskgreg-rad-0.3.1 lib/examples/hello_array.rb
madrona-rad-0.2.6 lib/examples/hello_array.rb
madrona-rad-0.2.7 lib/examples/hello_array.rb
madrona-rad-0.3.1.1 lib/examples/hello_array.rb
madrona-rad-0.3.1 lib/examples/hello_array.rb
madrona-rad-0.3.2 lib/examples/hello_array.rb
madrona-rad-0.3.3 lib/examples/hello_array.rb
madrona-rad-0.3.4 lib/examples/hello_array.rb
madrona-rad-0.3.5 lib/examples/hello_array.rb
madrona-rad-0.3.6 lib/examples/hello_array.rb
madrona-rad-0.3.7 lib/examples/hello_array.rb
madrona-rad-0.3.8 lib/examples/hello_array.rb
madrona-rad-0.3.9 lib/examples/hello_array.rb
madrona-rad-0.4.0 lib/examples/hello_array.rb
madrona-rad-0.5.0 lib/examples/hello_array.rb
madrona-rad-0.4.3 lib/examples/hello_array.rb
madrona-rad-0.4.2 lib/examples/hello_array.rb