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.

Sunday, April 27, 2014

Constance and Haley. Arduino. Fibionacci Sequence Blinking

We have completed the Arduino sketch to blink an LED according to the Fibonacci Sequence. We used three variables to create the sequence and keep track of how far into the sequence the Arduino is at any time.

Source code posted below:

int led = 13; int count1 = 0; int count2 = 1;
void setup() { pinMode(led, OUTPUT); }
void loop() { for (int i = 0; i < count1; i = i + 1) {digitalWrite(led, HIGH); delay(500); digitalWrite(led, LOW); delay(500); } int temp = count2; count2 = count1 + count2; count1 = temp; delay (1000); }

No comments:

Post a Comment