Created
March 21, 2010 16:09
-
-
Save flavioamieiro/339381 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
int ledPin = 13; | |
int fib(int n){ | |
return (n <= 1) ? 1 : (fib(n-1) + fib(n-2)); | |
} | |
void blink(int interval){ | |
digitalWrite(ledPin, HIGH); | |
delay(interval); | |
digitalWrite(ledPin, LOW); | |
delay(interval); | |
} | |
void setup() { | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() | |
{ | |
for (int i = 1; i < 10; i++){ | |
blink(fib(i) * 10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment