Created
January 7, 2010 23:51
-
-
Save lostcaggy/271729 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 Analoginput06b < ArduinoSketch | |
#Example 06B Set the brightness of the LED to a brighness specified by the value | |
#of the analgue input | |
#page 67 Getting started with arduino | |
output_pin 9, :as => :led #pin for led | |
@val = 0 | |
def loop | |
@val = analogRead(0) | |
analogWrite (led, @val/4) | |
delay 10 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment