As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Tuesday, May 6, 2014

Fibonacci by Ian and Roy

Fibonacci Sequence

int led = 13;
int num1 = 0;
int num2 = 1;
int fibonacci;

void setup(){
  pinMode(led, OUTPUT);
}
delay(1000+2000); //delay for no blinking and regular delay time

//blink once
digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(500);               // wait for a second
digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
delay(500);

delay(2000); //delay

//blink fibonacci
void loop(){
  fibonacci = num1 + num2;
  for (int i= 0; i < fibonacci; i++){
    digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(500);               // wait for a second
    digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
    delay(500);               // wait for a second
}
  delay(2000);
  num1 = num2;
  num2 = fibonacci;
}

No comments:

Post a Comment