Sha256: 0826f6735e74707caa1845f29a02b80a687c0f646308adc1ced6a163534a6c03

Contents?: true

Size: 934 Bytes

Versions: 23

Compression:

Stored size: 934 Bytes

Contents

class SparkfunLcd < ArduinoSketch


  input_pin 6, :as => :button_one, :latch => :off
  input_pin 7, :as => :button_two, :latch => :off
  input_pin 8, :as => :button_three, :latch => :off
  output_pin 13, :as => :led
  
  swser_LCDsf 5, :as => :my_lcd
  



#serial_begin # not necessary when using :device => :sf_lcd or :pa_lcd

  def loop
   check_buttons
  end
  

# need a bit

  def say_hello
    my_lcd.setxy 0,0			# line 0, col 0
		my_lcd.print "All your base   "
		my_lcd.setxy 0,1		# line 1, col 0
		my_lcd.print "are belong to us"
  
  end 
  
  def	say_ruby
		my_lcd.setxy 0,0			# line 0, col 0
		my_lcd.print " Ruby + Arduino "
		my_lcd.setxy 0,1		# line 1, col 0
		my_lcd.print " RAD 0.2.4+     "
		# un comment to change display startup
		#myLCD.setcmd 0x7C, 10
	end

  def check_buttons
  	read_and_toggle button_one, led
  	say_hello if read_input button_two
  	say_ruby if read_input button_three
  	
  	
  end
  
end

Version data entries

23 entries across 23 versions & 4 rubygems

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