Author Archives: lc3936

Reading Responses to Tigoe

 

Making Interactive Art: Set the Stage, Then Shut Up and Listen

I like Tigoe’s view of using interactive art as a framework to allow for a conversation between people and the work. I believe this approach can oftentimes lead to much more meaningful encounters than using the person as a part of the work, where the person reacts in a predetermined manner. An aspect that should be also be taken into consideration is the nature of the work, and the way in which the artist intends to express. Is the expression directed toward the immediate user, which would be the audience directly interacting with the work, or is it directed towards the bystander who observes the interaction between a person and the work? One of the most interesting elements about incorporating humans in art is that one cannot predict their reactions. This uncertainty is the key of why interactive art is so revolutionary, and by giving fixed instructions, the purpose would be defeated. Only when there is some room for exploration and genuine responses, interactive art can transcend the traditional categories of having a creator and a receiver of art, and instead combine it to be a two-way conversation between the artist and the audience.

An example of an interactive art piece that came to my mind is ‘Helena’ by Marco Evaristti. Evaristti placed ten blenders on a table, each of which were filled with water and a living goldfish. If a visitor decided to press one of the buttons on the ten blenders, the blender would run, and a fish would die. Superficially, it seemed like the only possible interaction was for the visitor to press one or more of the buttons, or not to do anything. However, another option that any visitor had was to plug the blenders from the power source, which no one did, which might be because the signifier for that action was much weaker.  The meaning of the piece is built through the audience’s interaction with the blenders. Would they decide to kill the fish, or let them stay alive?  What do humans do when given the power to decide over life and death of another being? Without the audience’s interaction, the work would lose most of its meaning. And I would say that the cumulative decisions of the audience are the key part of the artist’s expression rather than the experience of an individual audience member who decides to press or not to press the button. The artist, by making the artwork interactive, had found a way to expose a dark side of the audience that is rarely expressed.

 

Physical Computing’s Greatest Hits (and misses)

I found it great to see the variety of possibilities in all these examples of physical computing. My favorite is probably the video mirror- every time I walk past the IM lab I cannot help but make some weird moves as I walk past the screens.  The examples definitely gave me some inspiration for possible future projects or the midterm projects, and also some lessons on what not to do. 

 

 

 

 

Emotibot Midterm

Emotibot Midterm

Concept:

With a new update, my phone now has the function to send so called bitmojis that will recognize my face expression and turn it into an avatar so that I can express my feelings in an image rather than in words. Even though the avatar looks vaguely like me, it is actually an animated cartoon. I found it fascinating how humans so easily “recognize” emotional expressions in non-human things. This was the inspiration for my midterm project, in which I aim to create a physical face that can express a variety of human emotions without looking distinctively human, but more like a robot.

First idea:

 

 

My plan was to recreate the three main components of a human face: Eyes, mouth, and eyebrows. Initially I wanted to control the eyebrows using servos, eyes using motors, and the mouth using an array of LEDs. However, I discovered the LCD display and thought it would be better to represent the mouth using that, as the problem with the LEDs is also that they can still be seen even when they are off, which would not fit the purpose. At this point, I had no idea how much time and effort it would take me to display three different but simple mouth images.

 

I found this very helpful tutorial to use the LCD display here:

https://lastminuteengineers.com/arduino-1602-character-lcd-tutorial/

 

I first thought I could somehow upload the image of a mouth, or convert it, and it would just show up on the screen. But I quickly realized that the LCD display doesn’t work that way. It can display alphanumeric elements on 16*2 fields that are each 8*5 pixels. In addition to that it can store a maximum of eight special characters that can be defined by the user. So, this meant that I could only use eight different 8*5 pixel bits to make three different mouths, and I was not sure if that would work at all.

I used an excel sheet to design the images. These are the eight special elements I eventually came up with to use them to draw.

As you can see, all mouths consist of only these elements.

 

 

 

 

Neutral Mouth:

Sad Mouth:

Happy mouth:

I planned to make complete lips that are curving up and down, but due to the limitations it ended up being a simple curve up and down. However, since emoticons and smileys have become so universal in representing emotions it might even be more fitting to use curves rather than mouth images for the purpose of this project, after all it’s a “robot” and not a human. 

This is the first prototype of the face, made using cardboard:

This is the final face (in happy mode):

Circuit Diagram:

 

There are three buttons that can be pressed. They are indistinguishable, because I want the user to be surprised by the reaction of the robot. The three emotions that the robot can express are sadness, slight happiness, and anger. These are created by adjusting servo positions and the LCD display. In addition, if all three buttons are pressed simultaneously, it goes into “confusion mode” which makes the eyes (motors) turn and the eyebrows (servos) loop to move up and down. The LCD, instead of showing a mouth, shows the words “SAD HAPPY ANGRY” in a loop. I added this mode because in robot movies, when robots have to deal with conflicting commands or dilemmas, they often react by dysfunctioning or exploding, and I thought it would be fun to add that feature.

 

Video Demonstrations:

confusion mode

happy sad angry

Problems and Solutions:

I had multiple problems with the motors, which represent the eyes. I initially wanted them to move forward and backward together with the movement of the servos. However, the movements were unpredictable both due to the immense friction to the acrylic plate, and the natural deviations in rotational speed of the motors. To fix the first problem, I wrapped the tires in cloth, to decrease the friction, which worked. But I couldn’t figure out how to make the tires move 30 degrees forward when button 1 is pressed, and 30 degrees backward when button 2 is pressed. It was not precise enough to keep the eyes in place. In hindsight, I should have used servos for the eyes as they can be set to precise angles, and I later found out that there are even servos that can rotate completely.

Code:

#include <LiquidCrystal.h>

#include <Servo.h>


// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(A2, A1, 5, 4, 3, 2);

const int button1 = A5; //initializing buttons

const int button2 = A4;

const int button3 = A3;




int buttonState1 = 0;  //variables to read the buttons

int buttonState2 = 0;

int buttonState3 = 0;




int servoPin1 = 6; //servo variables

int servoPin2 = 7;

// Create a servo objects

Servo Servo1;

Servo Servo2;

//the right motor will be controlled by the motor A pins on the motor driver

const int rightcontrol1 = 13;           //control pin 1 on the motor driver for the right motor

const int rightcontrol2 = 12;            //control pin 2 on the motor driver for the right motor

const int rightspeed = 11;            //speed control pin on the motor driver for the right motor




//the left motor will be controlled by the motor B pins on the motor driver

const int leftspeed = 10;           //speed control pin on the motor driver for the left motor

const int leftcontrol2 = 9;           //control pin 2 on the motor driver for the left motor

const int leftcontrol1 = 8;           //control pin 1 on the motor driver for the left motor




int clearscreen = 0; //variable to store state of lcd screen       




// the custom characters

byte smalluphigh[8] =

{

  0b10111,

  0b01111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111

};




byte smalldownhigh[8] =

{

  0b11101,

  0b11110,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111

};




byte linehigh[8] =

{

  0b11111,

  0b11111,

  0b00000,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111

};




byte linelow[8] =

{

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b00000,

  0b11111,

  0b11111

};




byte smalldownlow[8] =

{

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b01111,

  0b10111

};







byte smalluplow[8] =

{

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11111,

  0b11110,

  0b11101

};




byte up[8] =

{

  0b11111,

  0b11111,

  0b11110,

  0b11101,

  0b10011,

  0b01111,

  0b11111,

  0b11111

};




byte down[8] =

{

  0b11111,

  0b11111,

  0b01111,

  0b10111,

  0b11001,

  0b11110,

  0b11111,

  0b11111

};







void setup()

{




 Servo1.attach(servoPin1);

 Servo2.attach(servoPin2);




  // initializing LCD and setting up the number of columns and rows:

 lcd.begin(16, 2);




  //create the new characters

 lcd.createChar(0, smalluphigh);

 lcd.createChar(1, smalldownhigh);

 lcd.createChar(2, linehigh);

 lcd.createChar(3, linelow);

 lcd.createChar(4, smalldownlow);

 lcd.createChar(5, smalluplow);

 lcd.createChar(6, up);

 lcd.createChar(7, down);




 pinMode(button1, INPUT);

 pinMode(button2, INPUT);

 pinMode(button3, INPUT);




  //set the motor control pins as outputs

 pinMode(rightcontrol1, OUTPUT);

 pinMode(rightcontrol2, OUTPUT);

 pinMode(rightspeed, OUTPUT);




 pinMode(leftcontrol1, OUTPUT);

 pinMode(leftcontrol2, OUTPUT);

 pinMode(leftspeed, OUTPUT);







 Serial.begin(9600);




  // Clears the LCD screen

 lcd.clear();

}




void loop()

{

 buttonState1 = digitalRead(button1);

 buttonState2 = digitalRead(button2);

 buttonState3 = digitalRead(button3);




  if (buttonState1 == HIGH && buttonState2 == HIGH && buttonState3 == HIGH) { //display craze face

   clearscreen = 1;    \\indicate that the screen as to be cleared when switching to another mode

   lcd.print("HAPPY SAD ANGRY ");

   lcd.scrollDisplayLeft();    




    //make servos go crazy

    for (int pos = 60; pos <= 100; pos += 1) {    //increase the position of the servo    

 Servo1.write(pos);

     Servo2.write(pos);

     delay(15);

    }

    for (int pos = 100; pos >= 60; pos -= 1) {   //decrease the position of the servo

     Servo1.write(pos);

     Servo2.write(pos);

     delay(10);




     //turning the eyes (motors)

     digitalWrite(rightcontrol1, HIGH);                         //set pin 1 to high

     digitalWrite(rightcontrol2, LOW);                          //set pin 2 to low




     digitalWrite(leftcontrol1, LOW);                         

      digitalWrite(leftcontrol2, HIGH);




     analogWrite(leftspeed, 100);

     analogWrite(rightspeed, 100);




    }

  }




  else if (buttonState1 == HIGH) {  //displays sad face

   Servo1.write(45);

   Servo2.write(135);


    if (clearscreen == 1) {

      lcd.clear();

      clearscreen = 0;

    }




   lcd.setCursor(4, 0);

   lcd.print(" ");




   lcd.setCursor(5, 0);

   lcd.print(" ");




   lcd.setCursor(6, 0);

   lcd.write(byte(5));




   lcd.setCursor(7, 0);

   lcd.write(byte(3));




   lcd.setCursor(8, 0);

   lcd.write(byte(3));




   lcd.setCursor(9, 0);

   lcd.write(byte(3));




   lcd.setCursor(10, 0);

   lcd.write(byte(4));




   lcd.setCursor(11, 0);

   lcd.print(" ");




   lcd.setCursor(12, 0);

    lcd.print(" ");




   lcd.setCursor(4, 1);

   lcd.print(" ");




   lcd.setCursor(5, 1);

   lcd.write(byte(6));




   lcd.setCursor(6, 1);

   lcd.write(byte(0));




   lcd.setCursor(7, 1);

   lcd.print(" ");




   lcd.setCursor(8, 1);

   lcd.print(" ");




   lcd.setCursor(9, 1);

   lcd.print(" ");




   lcd.setCursor(10, 1);

   lcd.write(byte(1));




   lcd.setCursor(11, 1);

   lcd.write(byte(7));




   analogWrite(leftspeed, 0);

   analogWrite(rightspeed, 0);

  }




  else if (buttonState2 == HIGH) {  //displays happy face




   Servo1.write(80);

   Servo2.write(100);







    if (clearscreen == 1) {

     lcd.clear();

     clearscreen = 0;

    }




   lcd.setCursor(4, 0);

   lcd.print(" ");




   lcd.setCursor(5, 0);

   lcd.write(byte(4));




   lcd.setCursor(6, 0);

   lcd.print(" ");




   lcd.setCursor(7, 0);

   lcd.print(" ");




   lcd.setCursor(8, 0);

   lcd.print(" ");




   lcd.setCursor(9, 0);

   lcd.print(" ");




   lcd.setCursor(10, 0);

   lcd.print(" ");




   lcd.setCursor(11, 0);

   lcd.write(byte(5));




   lcd.setCursor(4, 1);

   lcd.print(" ");




   lcd.setCursor(5, 1);

   lcd.write(byte(1));




   lcd.setCursor(6, 1);

   lcd.write(byte(7));




   lcd.setCursor(7, 1);

   lcd.write(byte(3));




   lcd.setCursor(8, 1);

   lcd.write(byte(3));




   lcd.setCursor(9, 1);

   lcd.write(byte(3));




   lcd.setCursor(10, 1);

   lcd.write(byte(6));




   lcd.setCursor(11, 1);

   lcd.write(byte(0));




    analogWrite(leftspeed, 0);

   analogWrite(rightspeed, 0);

  }


  else if (buttonState3 == HIGH) {  //displays angry face


   Servo1.write(135);

   Servo2.write(45);

    if (clearscreen == 1) {

     lcd.clear();

     clearscreen = 0;

    }




   lcd.setCursor(4, 1);

   lcd.print(" ");




   lcd.setCursor(5, 1);

   lcd.print(" ");




   lcd.setCursor(6, 1);

   lcd.print(" ");




   lcd.setCursor(7, 1);

   lcd.print(" ");




   lcd.setCursor(8, 1);

   lcd.print(" ");




   lcd.setCursor(9, 1);

   lcd.print(" ");




   lcd.setCursor(10, 1);

   lcd.print(" ");




   lcd.setCursor(11, 1);

   lcd.print(" ");




   lcd.setCursor(4, 0);

   lcd.write(byte(5));




   lcd.setCursor(5, 0);

   lcd.write(byte(6));




   lcd.setCursor(6, 0);

   lcd.write(byte(7));




   lcd.setCursor(7, 0);

   lcd.write(byte(6));




   lcd.setCursor(8, 0);

   lcd.write(byte(7));




   lcd.setCursor(9, 0);

   lcd.write(byte(6));




   lcd.setCursor(10, 0);

    lcd.write(byte(7));




   lcd.setCursor(11, 0);

   lcd.write(byte(4));




   analogWrite(leftspeed, 0);

   analogWrite(rightspeed, 0);

  }




  else {  //displays neutral mouth

   Servo1.write(90);

   Servo2.write(90);



    if (clearscreen == 1) {

     lcd.clear();

     clearscreen = 0;

    }


   lcd.setCursor(4, 0);

   lcd.write(byte(5));




   lcd.setCursor(5, 0);

   lcd.write(byte(6));




   lcd.setCursor(6, 0);

   lcd.write(byte(2));




   lcd.setCursor(7, 0);

    lcd.write(byte(7));




   lcd.setCursor(8, 0);

   lcd.write(byte(6));




   lcd.setCursor(9, 0);

   lcd.write(byte(2));




   lcd.setCursor(10, 0);

   lcd.write(byte(7));




   lcd.setCursor(11, 0);

   lcd.write(byte(4));




   lcd.setCursor(4, 1);

   lcd.write(byte(1));




   lcd.setCursor(5, 1);

   lcd.write(byte(7));




   lcd.setCursor(6, 1);

   lcd.write(byte(3));




   lcd.setCursor(7, 1);

   lcd.write(byte(3));




   lcd.setCursor(8, 1);

   lcd.write(byte(3));




    lcd.setCursor(9, 1);

   lcd.write(byte(3));




   lcd.setCursor(10, 1);

   lcd.write(byte(6));




   lcd.setCursor(11, 1);

   lcd.write(byte(0));


   analogWrite(leftspeed, 0);

   analogWrite(rightspeed, 0);

  }

}



 

 

 

Week 4 Musical Instrument by Gauri, Will, Li

Concept

We created a simple two-player instrument. The instrument is controlled using 12 buttons and one potentiometer. One player controls eight buttons which play eight major chords, and the other player can press the other four buttons corresponding to the other four major chords, as well as the potentiometer which modifies the speed of the rhythm machine. The rhythm is given by a drum-like installation built using a servo, two metal cans, and a wooden frame. LEDs provide visual feedback as to which buttons are pressed. Cooperation between both players is required to create a pleasant melody.

Schematic:

The button circuit

The servo circuit

Code:

Button program:

int yellow1 = 2; //C
int yellow2 = 6; //C sharp
int yellow3 = 10;   //D
int green1  = 3; //D sharp
int green2  = 7; //E
int green3  = 11;    //F
int red1    = 4; //F sharp
int red2    = 8; //G
int red3    = 12;   //G sharp
int blue1   = 5; //A
int blue2   = 9; //A sharp
int blue3   = A3;       //B
const int buzzer1 = A0;
const int buzzer2 = A1;
const int buzzer3 = A2;

#define C   262
#define E   330
#define G   392
#define Cs  277
#define F   349
#define Gs  415
#define D   294
#define A   440
#define Fs  370
#define Ab  415
#define B   494
#define Ds  311
#define As  466


void setup() {

  pinMode(yellow1, INPUT);
  pinMode(green1 , INPUT);
  pinMode(red1 , INPUT);
  pinMode(blue1 , INPUT);
  pinMode(yellow2 , INPUT);
  pinMode(green2 , INPUT);
  pinMode(red2 , INPUT);
  pinMode(blue2 , INPUT);
  pinMode(buzzer1, OUTPUT);
  pinMode(buzzer2, OUTPUT);
  pinMode(buzzer3, OUTPUT);

  Serial.begin(9600);
}

void loop() {
  if (digitalRead (yellow1) == true) {
    tone(buzzer1, C, 500);
    tone(buzzer2, E, 500);
    tone(buzzer2, G, 500);
  }
  else if (digitalRead (yellow2) == true) {
    tone(buzzer1, Cs, 500);
    tone(buzzer2, F, 500);
    tone(buzzer2, Gs, 500);
  }
  else if (digitalRead (yellow3) == true) {
    tone(buzzer1, D, 500);
    tone(buzzer2, Fs, 500);
    tone(buzzer2, A, 500);
  }

  else if (digitalRead (green1) == true) {
    tone(buzzer1, Ds, 500);
    tone(buzzer2, G, 500);
    tone(buzzer2, Ab, 500);
  }
  else if (digitalRead (green2) == true) {
    tone(buzzer1, E, 500);
    tone(buzzer2, Gs, 500);
    tone(buzzer3, B, 500);
  }
  else if (digitalRead (green3) == true) {
    tone(buzzer1, F, 500);
    tone(buzzer2, A, 500);
    tone(buzzer3, C, 500);
  }
  else if (digitalRead (red1) == true) {
    tone(buzzer1, Fs, 500);
    tone(buzzer2, Ab, 500);
    tone(buzzer3, Cs, 500);
  }
  else if (digitalRead (red2) == true) {
    tone(buzzer1, G, 500);
    tone(buzzer2, B, 500);
    tone(buzzer3, D, 500);
  }
  else if (digitalRead (red3) == true) {
    tone(buzzer1, Ab, 500);
    tone(buzzer2, C, 500);
    tone(buzzer3, Ds, 500);
  }
  else if (digitalRead (blue1) == true) {
    tone(buzzer1, A, 500);
    tone(buzzer2, Cs, 500);
    tone(buzzer3, E, 500);
  }
  else if (digitalRead (blue2) == true) {
    tone(buzzer1, As, 500);
    tone(buzzer2, D, 500);
    tone(buzzer3, F, 500);
  }
  else if (digitalRead (blue3) == true) {
    tone(buzzer1, B, 500);
    tone(buzzer2, Ds, 500);
    tone(buzzer3, Fs, 500);
  }
  else {
    noTone(buzzer1);
    noTone(buzzer2);
    noTone(buzzer3);
  }
}

Servo program:

#include <Servo.h>

Servo myservo;

int pos = 60;

void setup() {
  myservo.attach(2);
  Serial.begin(9600);

}

void loop() {
  int servoDelay = analogRead(A0);
  servoDelay = map(servoDelay, 0, 1023, 2, 15);
  for (pos = 60; pos <= 100; pos += 1) {
    myservo.write(pos);
    delay(servoDelay);
  }
  for (pos = 100; pos >= 60; pos -= 1) {
    myservo.write(pos);
    delay(servoDelay);
  }
}

Behavior

Each push button, when pressed, activates its corresponding LED and a chord is played. This happens by playing a different tone on each of the three buzzers. Altogether we have twelve buttons which can play the 12 common major chords. The servo instrument is controlled by a potentiometer, and the speed of rotation is directly related to the position of the potentiometer. We kept the servo circuit separate from the button circuit because this way there was more power in each circuit (and it made the coding much easier). 

potentiometer rhythm control

buttons control chords

 

Week 4 Reading Response Li

I agree with Victor’s point that the general  vision of future interactive technology is being limited to 2 dimensional interfaces, which leaves a lot of room for improvement. I was reading “Dawn of the new everything” by Jaron Lanier, in which he suggested that the future of virtual reality should include haptic responses which may be made possible through changing pressure in gloves, or even through the manipulation of a magnetic field so that it seems like one is physically experiencing resistance when interacting with a holographic object. Similar technologies could be used for non-VR machine interactions.

An interesting point that Victor raises is the debate around the value of speech commands. My first thought was to disagree with him, after we convey most of our ideas through words. Words can be incredibly powerful to make creative exchange happen or to build a story. However, the problem with using words is that it requires the other end, the recipient of the information, to have a similar background knowledge and some creativity in order to give meaning to those words. Therefore, it is very difficult to make a machine understand a concept in the same way humans do, which limits the capabilities of speech as a medium of interaction. For example, before impressionism was “invented”, it would have been incredibly difficult to describe Monet’s style of painting to someone else, let alone a machine interface. And as Victor argues, even now that we know what impressionism is, it is still too broad for one to say “draw a flower, make it impressionistic.” Maybe one day that will change, as artificial intelligence becomes better and more adapted to understanding human language. 

 

Week 3 Li: Reading Responses

The Design of Everyday Things – Don Norman

I really enjoyed this reading, and especially found the examples of badly designed objects quite amusing. Bad design choices are everywhere and can be really frustrating, such as the automatic door in front of D2. I agree with Norman that engineering has to consider human responses and not the ones of an ideal, rationally acting user. As I reflected more upon this, I began to realize there are endless factors that affect human responses, such as experience with particular technologies, cultural background, gender, or even time of the day and mood. How can human centered design account for all these things? Perhaps an all-considerate design is not possible, because  no matter how good it is, it is in human nature to be different from each other and to interact in different ways. A possible resolution could be to have different designs which are differentiated by consumer groups. Just hypothetically, I am imagining something like a piano that has adapted key sizes for humans with different sized hands (it is more difficult for children to play on the piano because the keys are so far apart compared to their hand size).

 

The Art of Interactive Design Chris Crawford

I found this reading to be highly thought provoking. I have never thought deeply about how interactivity is defined, even as an IM minor. I find the listen, think, speak metaphor that Crawford described very fitting, because interaction always involves multiple sides that act in response to each other. It is interesting that he mentions the example of books and movies being very low on the interactivity scale, and I agree that they are usually not. However, there are some exceptions which show that it is not the medium in itself but the way one decides to use the medium that determines its level of interactivity. The medium limits the possible actions one can take, but one can find creative ways of bypassing these. An example would be “choose your own adventure” type books, where the reader chooses the path of the story by selecting between different page numbers. In that case, the book can “listen” to the reader’s choice and respond to that choice by “speaking” different storylines. Even some movies nowadays are truly interactive, such as Bandersnatch on Netflix. As new technologies emerge, this might open up more possibilities for media that are traditionally non-interactive to become more so. I wonder how this might happen to paintings, music, etc. While I cannot imagine how this could be implemented, I am sure that it is somehow possible.

 

Week 3 Li: Digital/Analogue Input/Output

Concept:

The idea behind this project is to use two LEDs and one buzzer as outputs, and the potentiometer and a button as inputs. When the button is pressed, the LEDs start blinking. The rate of blinking corresponds to the value of the potentiometer. The buzzer plays tones in sync with the blinking, and with a faster rate of blinking the frequency of the notes increases too.

video demonstration

Circuit Schematic:

Problems/Solutions:

When using the button, I had forgotten how to wire it and used the circuit given in the Arduino booklet, which stated to connect one end to the ground and the other directly to the input on the board, which did not work for me. I tried it with different buttons, wires, and input slots but nothing seemed to work and it gave random results. Eventually I looked at the video from last week’s assignment to recreate the wiring the way we learned it in class. 

Code:

const int potentiometer = A5;
const int blueLED = 4;
const int redLED = 3;
const int buzzer = 10;
int buttonState = 0;
int sensorValue = 0;
const int button = 8;

void setup() {
pinMode(blueLED, OUTPUT);
pinMode(redLED, OUTPUT);
pinMode(button, INPUT);
Serial.begin(9600);
}

#define c 261
#define d 294
#define e 329
#define f 349
#define g 392
#define a 440
#define h 493
#define C 523

void loop() {
sensorValue = analogRead(potentiometer);
sensorValue = map(sensorValue, 0, 1023, 1, 5);

if (digitalRead(button) == true) {
if (sensorValue == 1) {
digitalWrite(blueLED, LOW);
digitalWrite(redLED, HIGH);
tone(buzzer, 261);
delay(700);
digitalWrite(blueLED, HIGH);
digitalWrite(redLED, LOW);
tone(buzzer, 294);
delay(700);
}
else if (sensorValue == 2) {
digitalWrite(blueLED, LOW);
digitalWrite(redLED, HIGH);
tone(buzzer, e);
delay(400);
digitalWrite(blueLED, HIGH);
digitalWrite(redLED, LOW);
tone(buzzer, f);
delay(400);
}
else if (sensorValue == 3) {
digitalWrite(blueLED, LOW);
digitalWrite(redLED, HIGH);
tone(buzzer, g);
delay(200);
digitalWrite(blueLED, HIGH);
digitalWrite(redLED, LOW);
tone(buzzer, a);
delay(200);
}
else if (sensorValue == 4) {
digitalWrite(blueLED, LOW);
digitalWrite(redLED, HIGH);
tone(buzzer, h);
delay(100);
digitalWrite(blueLED, HIGH);
digitalWrite(redLED, LOW);
tone(buzzer, C);
delay(100);
}}
else {
noTone(buzzer);
digitalWrite(blueLED, HIGH);
digitalWrite(redLED, HIGH);
}}

 

 

 

 

 

Week 2 Li: Multimedia Input/Output

I first had the idea to use the potentiometer as an input and different LEDs as outputs. This worked quite well, so I added a buzzer to it and wrote the program so that the buzzer would have specific frequency as outputs, with the same conditions as the lights. So, different positions of the potentiometer would correspond to a specific tone and light. However, when I tried it out, I realized that one could only play continuous melodies with this method. To fix this, I replaced the potentiometer with four buttons, each of which turned on a lamp and a tone. It took me a long time to make it work, because I forgot to add a final else statement in the code to make everything turn off when there is no button pressed. The final product is a mini-instrument capable of playing very simple melodies such as “Mary’s little lamb”.

using-buttons

using-potentiometer

Week 1 Li: Washing Machines

 

Washing Machines are particularly forgiving beings. Ever pressed the wrong button, put in the washing liquid into the powder place, or accidentally broke of the handle of the door? These things happen all too frequently in NYUAD laundry rooms, but most of the times the clothes will come out clean regardless of all the mistakes that were made. It almost seems too simple. But have you ever noticed all those buttons and control knobs at the top front side of the machine? And do you know how to use them? After checking the settings on washing machines that were running in the laundry room in A5C, I noticed that without exception, all were on the standard setting (cotton). That probably means that most people haven’t paid further attention to all the magical possibilities that the washing machine offers, and instead simply put in their clothes, threw in some detergent, and pressed on start. That’s understandable, as all the different settings can seem overwhelming and confusing. What is the difference between Easy Care and Easy Care+ ? Is the purpose of the Eco button to make me feel less guilty about my CO2 emissions or does it actually make a difference? Which settings and temperatures should be used for jeans, silk, linen, cotton, synthetics, or what if I am too lazy to sort them and put everything together? In light of all these questions, most people simply go with the standard setting, and the interaction stays at a minimum. Don’t be one of them. Before you do your next load of laundry, check out this article on how to make the most of washing machine setting:
https://www.cnet.com/how-to/washing-machine-settings/

Week 1 Li: Bee and Flower Switch

I started by making a simple circuit with two loose wires. My idea was to make the switch work using the blow of air. I took two foam pieces, wrapped them in aluminum foil, and it actually worked: the light went on when the pieces touched and went off when I held them apart.  However, they were too heavy to be moved by air. So, I replaced the foam completely by two aluminum foil sheets taped to the wires, but then they were so light that both pieces flew away. Eventually, I kept one of the ends heavy, and the other one light, and connected the light end to a sturdy wire. This way, the switch was on in its natural state, but went off when there is air pressure applied to it. Somehow, this reminded me of a bee flying onto a flower and being blown away by the wind, so I drew this and taped it to the ends as decoration.

blow-switch