Skip to content

Instantly share code, notes, and snippets.

@lostcaggy
Created January 7, 2010 23:04
Show Gist options
  • Save lostcaggy/271700 to your computer and use it in GitHub Desktop.
Save lostcaggy/271700 to your computer and use it in GitHub Desktop.
class Analoginput < ArduinoSketch
#Example 06A Blink LED at a rate specified by the value of an analogue input
#from Page 66 of Getting started with Arduino
output_pin 13, :as => :led
@val = 0
def loop
@val = analogRead(0)
digitalWrite (led, 1)
delay @val
digitalWrite (led, 0)
delay @val
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment