Created
January 7, 2010 23:04
-
-
Save lostcaggy/271700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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