Skip to content

Instantly share code, notes, and snippets.

@flavioamieiro
Created March 21, 2010 16:09
Show Gist options
  • Save flavioamieiro/339381 to your computer and use it in GitHub Desktop.
Save flavioamieiro/339381 to your computer and use it in GitHub Desktop.
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