Small Talk
Physical Computing Midterm Project
SVA Interaction Design MFA
Dami You & Hanna Yoon
Small Talk is a tableware that makes elegant mood while having cup of tea, glass of wine. The color of light changes according to the temperature of the beverage.
1. Inspiration
2. Experiment
3. Prototyping
4. Final Work
Code:
const int tmp=A0; int redPin1 =6; int greenPin1 = 3; int bluePin1 = 5; int redPin2=11; int greenPin2= 9; int bluePin2= 10; int r=0; int g=0; int b=255; int fadeAmount=50; void setup() { pinMode(redPin1, OUTPUT); pinMode(greenPin1, OUTPUT); pinMode(bluePin1, OUTPUT); pinMode(redPin2, OUTPUT); pinMode(greenPin2, OUTPUT); pinMode(bluePin2, OUTPUT); Serial.begin(9600); } void setColor(int red, int green, int blue) { analogWrite(redPin1, red); analogWrite(greenPin1, green); analogWrite(bluePin1, blue); analogWrite(redPin2, red); analogWrite(greenPin2, green); analogWrite(bluePin2, blue); } void loop() { int lightLevel = analogRead( A1 ); Serial.println( lightLevel ); int sensorValue = analogRead(tmp); float mVoltage = sensorValue * 5000.0/1024.0; float tmpC = (mVoltage - 500) / 10.0; Serial.print(tmpC); Serial.println(" degrees C"); delay (500); float tmpRed = analogRead(tmp); float tmpBlue = analogRead(tmp); tmpRed = map( tmpC, 20, 33, 0, 254); tmpBlue = map( tmpC, 20, 30, 254, 0); delay(1000); if(lightLevel > 550){ setColor( tmpRed, 0, tmpBlue); } else {setColor (0,0,0);} } // if(tmp<oldtmp){ // for(r=0; r<=255; r+=5){ // setColor(r,g,b);} // r= r +=5; // g= g + tmpC-20; // b= b- (tmpC-20); //} //} //if(tmp>=oldtmp){ // for(b=0; b<= 255; b=+5){ // setColor(r,g,b);} //} // //else //{setColor(0,0,0); //} //}
Leave a Reply