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, April 12, 2016

Arduino: Incremental Pentameter. LKW & JL.



First LED blinks five times and pauses. Second LED starts at no blinks and gets up to five.



Jane Zihan Team. Arduino Practice


Blinked Speed changed to 0.2 seconds
Alternating between two lights
Cumulative blinking



Arduino Assignment || Sarah & Maureen

Arduino Test Drive

Varying Speed:
Woo! Simple input change. 

      void setup() {
        pinMode(13, OUTPUT);
      }

      void loop() {
        digitalWrite(13, HIGH);   
        delay(250);              
        digitalWrite(13, LOW);  
        delay(250);              
      }


Alternating:
The interesting part of this was working the breadboard correctly. There were certain rules about it I didn't understand just from the lecture. 

      void setup() {
        pinMode(8, OUTPUT);
        pinMode(9, OUTPUT);
      }

      void loop() {
        digitalWrite(8, HIGH);   
        delay(500);                     
        digitalWrite(8, LOW);    
        delay(500);                   
        digitalWrite(9, HIGH);   
        delay(500);                     
        digitalWrite(9, LOW);    
        delay(500);                    
      }

























Incrementing: 
Pretty straight-forward variable declaration and incrementation inside a for loop.  


      int increment = 0;

      void setup() {
            pinMode(13, OUTPUT);
      }

      void loop() {
            for (int i = 0; i <= increment; i++) { 
            digitalWrite(13, HIGH);   
            delay(150);                     
            digitalWrite(13, LOW);    
            delay(150);                    
            }
            increment++;
            delay(1000);
      }



Sarah Oakes
with partner Maureen McLennon

Arduino Assignment – Chaeji Kim & Allison Chan. The Duo.

1. Changing Blink Speed

2. Alternating Between Two Different Lights

3. Counting Blinks
For this last example, we added a delay after each loop to mark when the sequence has ended and the next one is starting.

Arduino Exercises - Natalie and Logan

1) Alter the speed at which the light blinks
The code below increases the duration the light is on to two seconds and decreases the time it is off to one tenth of a second. The setup code is not included because it remains unchanged from the original blink code.

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(2000);              // wait for a two seconds
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait for one tenth of a second
}

2) Alternate between two separate lights
This code causes the first light to blink on then off and then signals the second light to do the same

void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
  // initialize digital pin 10 as an output.
  pinMode(10, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(10, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

3) Increase the number of blinks by one with every pass
This code uses a simple for loop to execute the blink where the number of times to run the loop increases by one each time. There is a pause of three seconds between each count.

int count = 1;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  for(int i =0; i < count; i++) {
    digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);              // wait for a second
    digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
    delay(100);
  }
  count++;
    delay(3000);   // wait for three seconds
}

Three Arduino Exercises - Raj & Abe

Here are our three arduino examples: 

1. Different Blink Speed:





2. Alternating Blinks








3. Incremental Blinking









Arduino Testing - Andrea & Nick

Our three variations in Arduino featuring videos of each with the code.

1) Blink Speed
Code:
// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); pinMode(9, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(100); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(100); // wait for a second }


2) Alternating
Code:
// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); pinMode(9, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(200); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(200); // wait for a second digitalWrite(9, LOW); // turn the LED on (HIGH is the voltage level) delay(200); // wait for a second digitalWrite(9, HIGH); // turn the LED off by making the voltage LOW delay(200); // wait for a second }


3) Counting
Code:
int count = 0; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { count++; for (int i = 1; i <= count; i++) { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(200); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(200); // wait for a second } delay(1000); }