Sha256: f56c8cd85dff9eeb7a1e5e09d30fc57b36779b55e8f9db355dbf7748e4425f55

Contents?: true

Size: 938 Bytes

Versions: 23

Compression:

Stored size: 938 Bytes

Contents

class HysteresisDuel < ArduinoSketch
  
  # purpose 
  # side by side demo of affect of hysteresis on two different sensor readings
  # 
  #

  # requires one pa_lcd
  # two sensors or potentiometers



    output_pin 5, :as => :my_lcd, :device => :pa_lcd, :rate => 19200, :clear_screen => :true
    input_pin 1, :as => :sensor_one, :device => :sensor
    input_pin 2, :as => :sensor_two, :device => :sensor

    def setup
      delay 1000
      my_lcd.setxy 0,0, "hysteresis duel"
      delay 5000
      my_lcd.clearscr
    end

    def loop
      my_lcd.setxy 0,0, "direct"
      my_lcd.setxy 0,1, "one: "
      my_lcd.print analogRead sensor_one
      my_lcd.print " two: "
      my_lcd.print analogRead sensor_two
      my_lcd.setxy 0,2, "with hysteresis"
      my_lcd.setxy 0,3, "one: "
      my_lcd.print sensor_one.with_hyst 4
      my_lcd.print " two: "
      my_lcd.print sensor_two.with_hyst 4
      delay 230
    end

    
end

Version data entries

23 entries across 23 versions & 4 rubygems

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