Created
January 7, 2010 22:49
-
-
Save lostcaggy/271683 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 Analogled < ArduinoSketch | |
#Example 04 fade an LED in and out | |
#from page 59 of Getting started with Arduino | |
output_pin 9, :as => :led | |
@i = 1 | |
def loop | |
while @i < 255 do | |
analogWrite led, @i | |
@i +=1 | |
delay 10 | |
end | |
while @i > 0 do | |
analogWrite led, @i | |
@i -=1 | |
delay 10 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment