class SpectraSoftPot

Public Instance Methods

loop() click to toggle source
# File lib/examples/spectra_soft_pot.rb, line 23
def loop
  my_lcd.setxy 0,1
  # since lcd's have issues clearing tens and hundreds digits when reading ones, 
  # we use pad_int_to_str, which is a hack to display these cleanly
  # pad_int_to_str takes two arguments: an integer and the final string length
  # 
  my_lcd.print pad_int_to_str sensor_one.soft_lock, 3
  delay 100
end
setup() click to toggle source
# File lib/examples/spectra_soft_pot.rb, line 15
def setup
  delay 1000
  my_lcd.setxy 0,0, "spectra symbol"
  my_lcd.setxy 0,1, "soft pot"
  delay 5000
  my_lcd.clearscr
end