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.

Thursday, May 1, 2014

Fibonacci (Charlotte + Kendall)



Fibonacci Sequence



int led = 13;
int previousNumber = 0;
int currentNumber = 1;

void setup() {              

  pinMode(led, OUTPUT);  
}

//
void loop() {
  for(int i = 0; i < currentNumber; i++){
    blinkOneTime();
  }
  delay(800);
  // current number
  int temporary = currentNumber;
  // combining
  currentNumber = currentNumber + previousNumber;
  //previousNumber set currentNumber.
  previousNumber = temporary;
}


//blink once
void blinkOneTime() {
    digitalWrite(led, HIGH);
    delay(200);
    digitalWrite(led, LOW);
    delay(200);
}

No comments:

Post a Comment