-
The Code that WORKED
08/31/2018 at 07:07 • 0 commentswe encountered problems Processing couldn't read information properly from Arduino, so our lecturer offered a helping hand to solve the problems. Hence it looked like this:
Arduino
Main/idle page:
// Page 1 #define p1WaterTap 3 #define p1ShowerHot 6 #define p1ShowerCold 5 #define p1WallLightSwitch 7 // Page 2 #define p2SeatBelt 8 #define p2Radio 9 #define p2Engine 10 // Page 3 #define p3RemoteTV 11 #define p3FridgeDoor 12 #define p3WallLightSwitch A0 // Page indicators #define triggerP1 A3 #define triggerP2 A2 #define triggerP3 A1 boolean engagedPage1; boolean engagedPage2; boolean engagedPage3; boolean bookEngaged; #define serialSendDelay 1 // SETUP void setup() { // Page 1 pinMode(p1WaterTap, INPUT); pinMode(p1ShowerHot, INPUT); pinMode(p1ShowerCold, INPUT); pinMode(p1WallLightSwitch, INPUT); digitalWrite(p1WaterTap, HIGH); digitalWrite(p1ShowerHot, HIGH); digitalWrite(p1ShowerCold, HIGH); digitalWrite(p1WallLightSwitch, HIGH); // Page 2 pinMode(p2SeatBelt, INPUT); pinMode(p2Radio, INPUT); pinMode(p2Engine, INPUT); digitalWrite(p2SeatBelt, HIGH); digitalWrite(p2Radio, HIGH); digitalWrite(p2Engine, HIGH); // Page 3 pinMode(p3RemoteTV, INPUT); pinMode(p3FridgeDoor, INPUT); pinMode(p3WallLightSwitch, INPUT); digitalWrite(p3RemoteTV, HIGH); digitalWrite(p3FridgeDoor, LOW); digitalWrite(p3WallLightSwitch, HIGH); // Page indicators pinMode (triggerP1, INPUT); pinMode (triggerP2, INPUT); pinMode (triggerP3, INPUT); digitalWrite(triggerP1, HIGH); digitalWrite(triggerP2, HIGH); digitalWrite(triggerP3, HIGH); engagedPage1 = false; engagedPage2 = false; engagedPage3 = false; bookEngaged = false; // Serial communication Serial.begin(9600); Serial.println ("..."); } // END SETUP // LOOP void loop() { // Page 1 if (engagedPage1 == false) { if (digitalRead(triggerP1) == HIGH) { bookEngaged = true; engagedPage1 = true; Serial.print("x"); } } // Page 2 if (engagedPage2 == false) { if (digitalRead(triggerP2) == HIGH) { bookEngaged = true; engagedPage2 = true; Serial.print("y"); } } // Page 3 if (engagedPage3 == false) { if (digitalRead(triggerP3) == HIGH) { bookEngaged = true; engagedPage3 = true; Serial.print("z"); } } // If the book is engaged if (bookEngaged == true) { // Page 1 if ( engagedPage1 == true ) { InteractionsPage1(); } if ( digitalRead(triggerP1) == LOW ) { engagedPage1 = false; } // Page 2 if ( engagedPage2 == true ) { InteractionsPage2(); } if ( digitalRead(triggerP2) == LOW ) { engagedPage2 = false; } // Page 3 if ( engagedPage3 == true ) { InteractionsPage3(); } if ( digitalRead(triggerP3) == LOW ) { engagedPage3 = false; } // Reset book pages are not engaged if ( digitalRead(triggerP1) == LOW && digitalRead(triggerP2) == LOW ) { if ( digitalRead(triggerP3) == LOW ) { bookEngaged = false; engagedPage1 = false; engagedPage2 = false; engagedPage3 = false; Serial.print("<"); } } } // Flush serial just in case Serial.flush(); } // END LOOP
1st page:
void InteractionsPage1() { if ( Serial.read() == 62 ) { // Water tap if ( digitalRead(p1WaterTap) == LOW ) { Serial.print('a'); delay(serialSendDelay); } else if ( digitalRead(p1WaterTap) == HIGH ) { Serial.print('b'); delay(serialSendDelay); } // Shower if ( digitalRead(p1ShowerHot) == LOW ) { Serial.print('c'); delay(serialSendDelay); } else if ( digitalRead(p1ShowerCold) == LOW ) { Serial.print('d'); delay(serialSendDelay); } // Wall light switch if ( digitalRead(p1WallLightSwitch) == LOW ) { Serial.print('e'); delay(serialSendDelay); } } } // END InteractionsPage1
2nd page:
void InteractionsPage2() { if ( Serial.read() == 62 ) { // Seat belt if (digitalRead(p2SeatBelt) == LOW) { Serial.print('f'); delay(serialSendDelay); } // Radio if (digitalRead(p2Radio) == LOW) { Serial.print('g'); delay(serialSendDelay); } // Engine if (digitalRead(p2Engine) == LOW) { Serial.print('h'); delay(serialSendDelay); } } }
3rd page:
void InteractionsPage3() { if ( Serial.read() == 62 ) { // TV remote if (digitalRead(p3RemoteTV) == LOW) { Serial.print('i'); delay(serialSendDelay); } // Fridge door if (digitalRead(p3FridgeDoor) == LOW) { Serial.print('j'); delay(serialSendDelay); } else if (digitalRead(p3FridgeDoor) == HIGH) { Serial.println('l'); delay(serialSendDelay); } // Wall light switch if (digitalRead(p3WallLightSwitch) == LOW) { Serial.print('k'); delay(serialSendDelay); } } }
Processingmain/idle page:
import processing.serial.*; import processing.video.*; Serial myCommChannel; Movie theidlescene; //------------------Spread 1 Movie Bin------------------------------------------------------------ Movie wakeup01; Movie walktobathroom02; Movie waittoturnontap03; Movie turnontap04; Movie brushingteeth05; Movie turnofftap06; Movie outcome1A07; Movie outcome1B08; Movie continuewater09; Movie finishbrushteeth10; Movie walktoshower11; Movie waittohotandcold12; Movie outcomehot13; Movie outcomecold14; Movie shower15; Movie finishshower16; Movie waittopressswitch17; Movie pressswitch18; Movie outcome3A19; Movie outcome3B20; Movie goout21; //-------------------Spread 2 Movie Bin----------------------------------------------------------- Movie firstScene; Movie secondScene; Movie secondTwoScene; Movie thirdScene; Movie thirdTwoScene; Movie fourthScene; Movie fourthTwoScene; Movie fourthThreeScene; Movie fifthScene; Movie sixthScene; Movie sixthTwoScene; Movie sixthThreeScene; Movie seventhScene; Movie infoOne; Movie infoTwo; //--------------------Spread 3 Movie Bin---------------------------------------------------------- Movie reachhome_301; Movie sitdown_302; Movie waittopressremote_303; Movie pressremote_304; Movie watchtv_305; Movie walktofridge_306; Movie waittoopenfridge_307; Movie openfridge_308; Movie getfood_309; Movie outcomefridge_310; Movie waittoclosefridge_311; Movie closefridge_312; Movie walkbacktocouch_313; Movie yawn_314; Movie outcome1A_315; Movie outcome1B_316; Movie walktobedroom_317; Movie waittopressswitch_318; Movie outcome2A_319; Movie outcome2B_320; Movie gosleep_321; //------------------------------------------------------------------------------ boolean serialCreated = false; boolean idlescene = true; //--------------------Spread 1 Boolean---------------------------------------------------------- boolean wakeup101; boolean walk102; boolean waittap103; boolean turntapon104; boolean brushteeth105; boolean turntapoff106; boolean turntapoff106bad; boolean outcomebadwater107; boolean outcomegoodwater108; boolean continuewater109; boolean finishbrush110; boolean walktoshower111; boolean waitheater112; boolean outcomehot113; boolean outcomecold114; boolean finishshower116; boolean waitswitch1117; boolean pressswitch1118; boolean pressswitch1118bad; boolean outcomebadlight119; boolean outcomegoodlight120; boolean goout121; //-------------------Spread 2 Boolean---------------------------------------------------------- boolean firstPlaying; boolean secondPlaying; boolean secondTwoPlaying; boolean thirdPlaying; boolean thirdTwoPlaying; boolean fourthPlaying; boolean fourthTwoPlaying; boolean fourthThreePlaying; boolean fifthPlaying; boolean sixthPlaying; boolean infoOnePlaying; boolean infoTwoPlaying; boolean sixthTwoPlaying; boolean sixthThreePlaying; boolean seventhPlaying; //-------------------Spread 3 Boolean----------------------------------------------------------- boolean gohome_3301; boolean sitdown_3302; boolean waitremote_3303; boolean pressremote_3304; boolean watchtv_3305; boolean walktofridge_3306; boolean waitfridge_3307; boolean openfridge_3308; boolean getfood_3309; boolean outcomefridge_3310; boolean waitfridgeclose_3311; boolean closefridge_3312; boolean walkback_3313; boolean yawn_3314; boolean waitremoteoff_3315; boolean pressremoteoff_3316; boolean pressremoteoff_3316bad; boolean outcomebadremote_3317; boolean outcomegoodremote_3318; boolean walktobed_3319; boolean waitswitch3_3320; boolean pressswitch3_3321; boolean pressswitch3_3321bad; boolean outcomebadswitch_3322; boolean outcomegoodswitch_3323; boolean gosleep_3324; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ int myTime0000; int myTime0101; int myTime0102; int myTime0103; int myTime0201; int myTime0202; int myTime0203; int myTime0301; int myTime0302; int myTime0303; int myTime0304; int myTime0305; int waitTime = 7200; int waitReset = 10000; /* *SETUP */ void setup() { //printArray(Serial.list()); frameRate(25); //size (720,1080); fullScreen(2); initializeVariables(); if (serialCreated == false) { // Prevents serial from being re-created when sketch is reset myCommChannel = new Serial(this, Serial.list()[1], 9600); serialCreated = true; } theidlescene = new Movie (this, "00idle.mp4"); println("START"); InstantiateMoviesSpread1(); InstantiateMoviesSpread2(); InstantiateMoviesSpread3(); startCounting00(); } // END SETUP /* *DRAW */ void draw() { if (idlescene) { playidle(); } else { Spread1(); Spread2(); Spread3(); } } // END DRAW void startCounting00() { myTime0000 = millis(); } void movieEvent(Movie m) { m.read(); } void endit() { frameCount = -1; } char getSerialInput() { myCommChannel.write(">"); delay(1); char inputChar = myCommChannel.readChar(); return inputChar; } void mouseClicked() { //setup(); initializeVariables(); frameCount = -1; }
movie bin:
void InstantiateMoviesSpread1() { //----------------Define Spread 1 Movie-------------------------------------------------------------- wakeup01 = new Movie(this, "0101wakeup.mp4"); walktobathroom02 = new Movie(this, "0102walktoabathroom.mp4"); waittoturnontap03 = new Movie(this, "0103waittoturnonwatertap.mp4"); turnontap04 = new Movie(this, "0104turnonwatertap.mp4"); brushingteeth05 = new Movie (this, "0105brushteethloop.mp4"); turnofftap06 = new Movie(this, "0106turnofftap.mp4"); outcome1A07 = new Movie(this, "0108outcomeB.mp4"); outcome1B08 = new Movie(this, "0108outcomeB.mp4"); continuewater09 = new Movie(this, "0109contbrushingteethnowater.mp4"); finishbrushteeth10 = new Movie(this, "0110finishbrushteeth.mp4"); walktoshower11 = new Movie(this, "0111walktoshower.mp4"); waittohotandcold12 = new Movie(this, "0112waittohotandcold.mp4"); outcomehot13 = new Movie(this, "0113outcomeHot.mp4"); outcomecold14 = new Movie(this, "0114outcomeCold.mp4"); //shower15 = new Movie(this, "0115shower.mp4"); finishshower16 = new Movie(this, "0116comeoutshowertodoor.mp4"); waittopressswitch17 = new Movie(this, "0117waittopressswitch.mp4"); pressswitch18 = new Movie(this, "0118opressswitch.mp4"); outcome3A19 = new Movie(this, "0119outcomeA.mp4"); outcome3B20 = new Movie(this, "0120outcomeB.mp4"); goout21 = new Movie(this, "0121goout.mp4"); } void InstantiateMoviesSpread2() { //-----------------Define Spread 2 Movie------------------------------------------------------------- firstScene = new Movie(this, "02_02_01.mp4"); secondScene = new Movie(this, "02_02_02.mp4"); secondTwoScene = new Movie(this, "02_02_03.mp4"); thirdScene = new Movie(this, "02_03_01.mp4"); thirdTwoScene = new Movie (this, "02_03_02.mp4"); fourthScene = new Movie(this, "02_04_01.mp4"); fourthTwoScene = new Movie(this, "02_04_02.mp4"); fourthThreeScene = new Movie(this, "02_04_03.mp4"); fifthScene = new Movie(this, "02_05.mp4"); sixthScene = new Movie(this, "02_06_01.mp4"); sixthTwoScene = new Movie(this, "02_06_02.mp4"); sixthThreeScene = new Movie(this, "02_06_03.mp4"); seventhScene = new Movie(this, "02_07.mp4"); infoOne = new Movie(this, "infoTwo.mp4"); infoTwo = new Movie(this, "infoTwo.mp4"); } void InstantiateMoviesSpread3() { //---------------Define Spread 3 Movie--------------------------------------------------------------- reachhome_301 = new Movie(this, "0301arrive.mp4"); sitdown_302 = new Movie(this, "0302putandsit.mp4"); waittopressremote_303 = new Movie(this, "0303waittopressremote.mp4"); pressremote_304 = new Movie(this, "0304pressremote.mp4"); watchtv_305 = new Movie (this, "0305watchingtv.mp4"); walktofridge_306 = new Movie(this, "0306walktofridge.mp4"); waittoopenfridge_307 = new Movie(this, "0307waittoopenfridge.mp4"); openfridge_308 = new Movie(this, "0308openfridge.mp4"); getfood_309 = new Movie(this, "0309getfood.mp4"); outcomefridge_310 = new Movie(this, "0310outcomefridge.mp4"); waittoclosefridge_311 = new Movie(this, "0311waittoclosefridge.mp4"); closefridge_312 = new Movie(this, "0312closefridge.mp4"); walkbacktocouch_313 = new Movie(this, "0313walkbacktocouch.mp4"); yawn_314 = new Movie(this, "0314yawn.mp4"); outcome1A_315 = new Movie(this, "0316outcomeB.mp4"); outcome1B_316 = new Movie(this, "0316outcomeB.mp4"); walktobedroom_317 = new Movie(this, "0317walkingtobedroom.mp4"); waittopressswitch_318 = new Movie(this, "0117waittopressswitch.mp4"); outcome2A_319 = new Movie(this, "0320outcomeB.mp4"); outcome2B_320 = new Movie(this, "0320outcomeB.mp4"); gosleep_321 = new Movie(this, "0321gosleep.mp4"); }
1st page:
void Spread1() { if (wakeup101) { play101(); } if (walk102) { play102(); } if (waittap103) { play103(); } if (turntapon104) { play104(); } if (brushteeth105) { play105(); } if (turntapoff106) { play106(); } if (turntapoff106bad) { play106bad(); } if (outcomebadwater107) { play107(); } if (outcomegoodwater108) { play108(); } if (continuewater109) { play109(); } if (finishbrush110) { play110(); } if (walktoshower111) { play111(); } if (waitheater112) { play112(); } if (outcomehot113) { play113(); } if (outcomecold114) { play114(); } if (finishshower116) { play116(); } if (waitswitch1117) { play117(); } if (pressswitch1118) { play118(); } if (pressswitch1118bad) { play118bad(); } if (outcomebadlight119) { play119(); } if (outcomegoodlight120) { play120(); } if (goout121) { play121(); } } //-------------------SPREAD 1--------------------------------------------------- //------------------------------------------------------------------------------ void play101() { wakeup01.play(); image(wakeup01, 0, 0, wakeup01.width, wakeup01.height); if (wakeup01.time() >= wakeup01.duration()-0.3 ) { wakeup01.stop(); wakeup101 = false; walk102 = true; } } void play102() { walktobathroom02.play(); image(walktobathroom02, 0, 0, walktobathroom02.width, walktobathroom02.height); if (walktobathroom02.time() >= walktobathroom02.duration()-0.3 ) { walktobathroom02.stop(); walk102 = false; waittap103 = true; } } void play103() { waittoturnontap03.loop(); image(waittoturnontap03, 0, 0, waittoturnontap03.width, waittoturnontap03.height); char inputChar = getSerialInput(); switch (inputChar) { case 'a': waittoturnontap03.noLoop(); waittoturnontap03.stop(); waittap103=false; turntapon104 = true; myCommChannel.clear(); break; } } void play104() { turnontap04.play(); image(turnontap04, 0, 0, turnontap04.width, turnontap04.height); if (turnontap04.time() >= turnontap04.duration()-0.3 ) { turnontap04.stop(); turntapon104 = false; startCounting1One(); brushteeth105 = true; } } void startCounting1One() { myTime0101 = millis(); } void play105() { brushingteeth05.loop(); //if ( brushingteeth05.available() == true) { image(brushingteeth05, 0, 0, brushingteeth05.width, brushingteeth05.height); //} //if (millis() - myTime0101 >= waitTime) { // brushingteeth05.noLoop(); // brushingteeth05.stop(); // brushteeth105=false; // outcomebadwater107 = true; //} char inputChar = getSerialInput(); switch (inputChar) { case 'b': brushingteeth05.noLoop(); brushingteeth05.stop(); brushteeth105=false; turntapoff106 = true; myCommChannel.clear(); break; } } void play106() { turnofftap06.play(); image(turnofftap06, 0, 0, turnofftap06.width, turnofftap06.height); if (turnofftap06.time() >= turnofftap06.duration()-0.3 ) { turnofftap06.stop(); turntapoff106 = false; outcomegoodwater108 = true; } } void play107() { outcome1A07.loop(); //if (outcome1A07.available() == true) { image(outcome1A07, 0, 0, outcome1A07.width, outcome1A07.height); //} char inputChar = getSerialInput(); switch (inputChar) { case 'b': outcome1A07.noLoop(); outcome1A07.stop(); outcomebadwater107=false; turntapoff106bad = true; myCommChannel.clear(); break; } } void play106bad() { turnofftap06.play(); image(turnofftap06, 0, 0, turnofftap06.width, turnofftap06.height); if (turnofftap06.time() >= turnofftap06.duration()-0.3 ) { turnofftap06.stop(); turntapoff106 = false; continuewater109 = true; } } void play108() { outcome1B08.play(); image(outcome1B08, 0, 0, outcome1B08.width, outcome1B08.height); if (outcome1B08.time() >= outcome1B08.duration()-0.3 ) { outcome1B08.stop(); outcomegoodwater108 = false; continuewater109 = true; } } void play109() { continuewater09.play(); image(continuewater09, 0, 0, continuewater09.width, continuewater09.height); if (continuewater09.time() >= continuewater09.duration()-0.3 ) { continuewater09.stop(); continuewater109 = false; finishbrush110 = true; } } void play110() { finishbrushteeth10.play(); image(finishbrushteeth10, 0, 0, finishbrushteeth10.width, finishbrushteeth10.height); if (finishbrushteeth10.time() >= finishbrushteeth10.duration()-0.3 ) { finishbrushteeth10.stop(); finishbrush110 = false; walktoshower111 = true; } } void play111() { walktoshower11.play(); image(walktoshower11, 0, 0, walktoshower11.width, walktoshower11.height); if (walktoshower11.time() >= walktoshower11.duration()-0.3 ) { walktoshower11.stop(); walktoshower111 = false; waitheater112 = true; } } void play112() { waittohotandcold12.loop(); //if (waittohotandcold12.available() == true) { image(waittohotandcold12, 0, 0, waittohotandcold12.width, waittohotandcold12.height); //} char inputChar = getSerialInput(); switch (inputChar) { case 'c': waittohotandcold12.noLoop(); waittohotandcold12.stop(); waitheater112=false; startCounting1Two(); outcomehot113 = true; println("this is hot"); myCommChannel.clear(); delay(500); break; case 'd': waittohotandcold12.noLoop(); waittohotandcold12.stop(); waitheater112=false; startCounting1Two(); outcomecold114 = true; println("this is cold"); myCommChannel.clear(); delay(500); break; } } void startCounting1Two() { myTime0102 = millis(); } void play113() { outcomehot13.loop(); //if (outcomehot13.available() == true) { image(outcomehot13, 0, 0, outcomehot13.width, outcomehot13.height); //} if (millis() - myTime0102 >= waitTime) { outcomehot13.noLoop(); outcomehot13.stop(); outcomehot113=false; //shower115 = true; finishshower116 = true; println("playing hot"); } } void play114() { outcomecold14.loop(); //if (outcomecold14.available() == true) { image(outcomecold14, 0, 0, outcomecold14.width, outcomecold14.height); //} if (millis() - myTime0102 >= waitTime) { outcomecold14.noLoop(); outcomecold14.stop(); outcomecold114=false; //shower115 = true; finishshower116 = true; println("tplaying cold"); } } void play116() { finishshower16.play(); image(finishshower16, 0, 0, finishshower16.width, finishshower16.height); if (finishshower16.time() >= finishshower16.duration()-0.3 ) { finishshower16.stop(); finishshower116 = false; startCounting1Three(); waitswitch1117 = true; } } void startCounting1Three() { myTime0103 = millis(); } void play117() { waittopressswitch17.loop(); //if (waittopressswitch17.available() == true) { image(waittopressswitch17, 0, 0, waittopressswitch17.width, waittopressswitch17.height); //} if (millis() - myTime0103 >= waitTime) { waittopressswitch17.noLoop(); waittopressswitch17.stop(); waitswitch1117=false; outcomebadlight119 = true; } char inputChar = getSerialInput(); switch (inputChar) { case 'e': waittopressswitch17.noLoop(); waittopressswitch17.stop(); waitswitch1117=false; pressswitch1118 = true; myCommChannel.clear(); break; } } void play118() { pressswitch18.play(); image(pressswitch18, 0, 0, pressswitch18.width, pressswitch18.height); if (pressswitch18.time() >= pressswitch18.duration()-0.3 ) { pressswitch18.stop(); pressswitch1118 = false; outcomegoodlight120 = true; } } void play119() { outcome3A19.loop(); //if (outcome3A19.available() == true) { image(outcome3A19, 0, 0, outcome3A19.width, outcome3A19.height); //} char inputChar = getSerialInput(); switch (inputChar) { case 'e': outcome3A19.noLoop(); outcome3A19.stop(); outcomebadlight119=false; pressswitch1118bad = true; myCommChannel.clear(); break; } } void play118bad() { pressswitch18.play(); image(pressswitch18, 0, 0, pressswitch18.width, pressswitch18.height); if (pressswitch18.time() >= pressswitch18.duration()-0.3 ) { pressswitch18.stop(); pressswitch1118bad = false; goout121 = true; } } void play120() { outcome3B20.play(); image(outcome3B20, 0, 0, outcome3B20.width, outcome3B20.height); if (outcome3B20.time() >= outcome3B20.duration()-0.3 ) { outcome3B20.stop(); outcomegoodlight120 = false; goout121 = true; } } void play121() { goout21.play(); image(goout21, 0, 0, goout21.width, goout21.height); if (goout21.time() >= goout21.duration()-0.3 ) { goout21.stop(); goout121 = false; //initializeVariables(); //idlescene = true; endit(); } }
2nd page:
void Spread2() { if (firstPlaying) { playFirstScene(); } if (secondPlaying) { playSecondScene(); } if (secondTwoPlaying) { playSecondTwoScene(); } if (thirdPlaying) { playThirdScene(); } if (thirdTwoPlaying) { playThirdTwoScene(); } if (fourthPlaying) { playFourthScene(); } if (fourthTwoPlaying) { playFourthTwoScene(); } if (fourthThreePlaying) { playFourthThreeScene(); } if (fifthPlaying) { playFifthScene(); } if (sixthPlaying) { playSixthScene(); } if (infoOnePlaying) { playInfoOne(); } if (sixthTwoPlaying) { playSixthTwoScene(); } if (infoTwoPlaying) { playInfoTwo(); } if (sixthThreePlaying) { playSixthThreeScene(); } if (seventhPlaying) { playSeventhScene(); } } //-------------------SPREAD 2--------------------------------------------------- //------------------------------------------------------------------------------ void playFirstScene() { firstScene.play(); //image(firstScene, 0, 0, firstScene.width, firstScene.height); image(firstScene, 0, 0, width, height); if (firstScene.time() >= firstScene.duration()-0.3 ) { firstScene.stop(); firstPlaying = false; secondPlaying = true; } } void playSecondScene() { secondScene.play(); //image(secondScene, 0, 0, secondScene.width, secondScene.height); image(secondScene, 0, 0, width, height); if (secondScene.time() >= secondScene.duration()-0.3) { secondScene.stop(); secondPlaying = false; secondTwoPlaying = true; } } void playSecondTwoScene() { secondTwoScene.play(); //image(secondTwoScene, 0, 0, secondTwoScene.width, secondTwoScene.height); image(secondTwoScene, 0, 0, width, height); if (secondTwoScene.time() >= secondTwoScene.duration()-0.3) { secondTwoScene.stop(); secondTwoPlaying = false; thirdPlaying = true; } } void playThirdScene() { thirdScene.loop(); //if (thirdScene.available() == true) { //image(thirdScene, 0, 0, thirdScene.width, thirdScene.height); image(thirdScene, 0, 0, width, height); //} char inputChar = getSerialInput(); switch (inputChar) { case 'f': thirdScene.noLoop(); thirdScene.stop(); thirdPlaying=false; thirdTwoPlaying = true; myCommChannel.clear(); break; } } void playThirdTwoScene() { thirdTwoScene.play(); //image(thirdTwoScene, 0, 0, thirdTwoScene.width, thirdTwoScene.height); image(thirdTwoScene, 0, 0, width, height); if (thirdTwoScene.time() >= thirdTwoScene.duration()-0.3) { thirdTwoScene.stop(); thirdTwoPlaying=false; fourthPlaying = true; } } void playFourthScene() { fourthScene.loop(); //if (fourthScene.available() == true) { //image(fourthScene, 0, 0, fourthScene.width, fourthScene.height); image(fourthScene, 0, 0, width, height); //} char inputChar = getSerialInput(); switch (inputChar) { case 'g': fourthScene.noLoop(); fourthScene.stop(); fourthPlaying=false; fourthTwoPlaying = true; myCommChannel.clear(); break; } } void playFourthTwoScene() { fourthTwoScene.play(); //image(fourthTwoScene, 0, 0, fourthTwoScene.width, fourthTwoScene.height); image(fourthTwoScene, 0, 0, width, height); if (fourthTwoScene.time() >= fourthTwoScene.duration()-0.3) { fourthTwoScene.stop(); fourthTwoPlaying=false; fourthThreePlaying = true; } } void playFourthThreeScene() { fourthThreeScene.play(); //image(fourthThreeScene, 0, 0, fourthThreeScene.width, fourthThreeScene.height); image(fourthThreeScene, 0, 0, width, height); if (fourthThreeScene.time() >= fourthThreeScene.duration()-0.3) { fourthThreeScene.stop(); fourthThreePlaying=false; fifthPlaying = true; } } void playFifthScene() { fifthScene.play(); //image(fifthScene, 0, 0, fifthScene.width, fifthScene.height); image(fifthScene, 0, 0, width, height); if (fifthScene.time() >= fifthScene.duration()-0.3) { fifthScene.stop(); fifthPlaying=false; startCounting2(); //println(myTime); sixthPlaying = true; } } void startCounting2() { myTime0201 = millis(); } void playSixthScene() { sixthScene.loop(); //if (sixthScene.available() == true) { //image(sixthScene, 0, 0, sixthScene.width, sixthScene.height); image(sixthScene, 0, 0, width, height); //} if (millis() - myTime0201 >= waitTime) { sixthScene.noLoop(); sixthScene.stop(); sixthPlaying=false; startCounting2Two(); infoOnePlaying = true; println("this is detected"); } char inputChar = getSerialInput(); switch (inputChar) { case 'h': sixthScene.noLoop(); sixthScene.stop(); sixthPlaying=false; sixthTwoPlaying = true; println("good"); myCommChannel.clear(); break; } } void startCounting2Two() { myTime0202 = millis(); } void playInfoOne() { println("playing info one"); infoOne.loop(); //if (infoOne.available() == true) { //image(infoOne, 0, 0, infoOne.width, infoOne.height); image(infoOne, 0, 0, width, height); //} if (millis() - myTime0202 >= waitTime) { infoOne.noLoop(); infoOne.stop(); infoOnePlaying=false; sixthThreePlaying = true; } } void playSixthTwoScene() { sixthTwoScene.play(); //image(sixthTwoScene, 0, 0, sixthTwoScene.width, sixthTwoScene.height); image(sixthTwoScene, 0, 0, width, height); if (sixthTwoScene.time() >= sixthTwoScene.duration()-0.3) { sixthTwoScene.stop(); sixthTwoPlaying = false; startCounting2Three(); infoTwoPlaying = true; } } void startCounting2Three() { myTime0203 = millis(); } void playInfoTwo() { infoTwo.loop(); //if (infoTwo.available() == true) { //image(infoTwo, 0, 0, infoTwo.width, infoTwo.height); image(infoTwo, 0, 0, width, height); //} if (millis() - myTime0203 >= waitTime) { infoTwo.noLoop(); infoTwo.stop(); infoTwoPlaying=false; sixthThreePlaying = true; } } void playSixthThreeScene() { sixthThreeScene.play(); //image(sixthThreeScene, 0, 0, sixthThreeScene.width, sixthThreeScene.height); image(sixthThreeScene, 0, 0, width, height); Final Update 08/31/2018 at 07:06 • 0 comments
After the User Test on (2/8), there were several components needed upgrade:
- structure – nonexistent and/or not convincing nor appealing
- book mechanisms is not working
Week 12:
8/8:
- meeting with lecturer to discuss and plan the book mechanism
- lecturer helped with assembling the metal structures that required power tools
mechanism update: 3D printed dial with micro switch, some stoppers may be applied
9/8:
- 3D printing and trial-and-error-ing the measurement to fit to the book
- animation work still going on
- copywriting work on the book
Week 13:
13/8:
- laser cut the remaining book structure, the bones, to make the hollow space to fit the sensors
- continue working on the interact-ables (3D printing work)
- animation work still going on
- copywriting work on final messages
14/8:
- printed the finalised pages
- sticking it to the woodpieces
- measuring & make cuts on corrugated boards for the structure
we need a few panels to cover up the front & back, sides & top
15/8:
- hand cutting and laser cutting corrugated boards to desired measurements
- cutting holes into the plywood to attach sensors and interact-ables
- animation needs some fine tune and refining
16/8:
- getting a PC for display and run Processing (spoiler: it didn't work, we didn't have converter for VGA to HDMI; backup plan required)
- fine tuning of animation
- sticking the wooden frame, now they've got hollow spaces (spoiler: we made a mistake, we didn't put in the nut for the screws later, DOH!)
this day we're overnight-ing at college for another projects needed to be submitted in 4 days and required many hours to complete, there wasn't much progress after this.
Week 14:
21/8:
we're just done with our other projects, today is a rest day, preparing for an overnight tomorrow
- fix the nonexistent slot for the nut that we forgot to put on beforehand
- redid the acrylic by putting car tint film to prevent reflection instead of the blue filter paper because it's inconsistent and bubbly
mistake oh mistake 22/8 (public holiday) - 23/8 :
wow no holiday, bye holiday
- full day working on the book and measuring the structure
- attaching sensors to where they belong and their corresponding interact-ables
- fine tuning animation
- structure work
- copywriting work
- coding work
- wiring work (spoiler: too messy our lecturer needed to hands on)
final look in case something bad happens, this is working perfectly, btw
23/8 (final client review):
- lecturer fixed the wiring
- final touch wiring & stickers placing
- screw everything together
- animation is complete
- structure is 80% complete, need some fine tuning
client review result:
- a few bug (major bug) in the code
- animation needs some final fine tuning here and there
OVERNIGHT pt.2
23/8 - 24/8:
- too tired there are a lot of nap breaks
- tried fixing the code but to no avail
- animation is complete
- structure is complete
- in the morning our lecturer came up with solutions for the code (much thanks awlolo)
- problems solved
- wait until 10pm to bring over installation to Sunway Pyramid for the setup
OVERNIGHT pt.3
24/8-25/8:
- worked whole night (with slacks and McD break hehe thanks) to setup and try the user journey over and over again to make sure it works, but too bad nothing is perfect.
Mao with Mao 25/8 (Exhibition day):
- needs to reset(code word: banana) after a few times because it gets laggy
- exhibition went well, OK
- fix the instructions on the animation for the next day, it was rather unclear at first
before edit (no instructions):
after edit (with instructions):
exhibition gallery:
26/8 (final day):
- on the last day after some code rigging and animation change, it looked like this
- we figured it was too much work to fix the entire code, so we just went with it and rig the code just one more day
we allow people to write on our panels so here are a few words from our friends, strangers, even fellow seniors:
after it ended, we dismantled and left the place, went to boston lala, and ended the day.
to end on a high note, we went for a nice lunch the next day, to celebrate everyone's hard-work-paid-off, yeay!
our video journal:
(unlisted link)
USER TEST
08/14/2018 at 04:22 • 0 comments2/8
problem: wiring is too messy and complicated.
theCode #1
08/12/2018 at 17:39 • 0 commentsFirst attempt to put in the coding structure
second spread is already working pretty well.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
haven't tried on the actual tangible sensors yet, but will do and post an update!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
on arduino:
Project Log Entry for DI_UN_SWP //on arduino: #define firstbutton 5 #define secondbutton 4 #define thirdbutton 3 void setup() { pinMode(firstbutton,INPUT); pinMode(secondbutton,INPUT); pinMode(thirdbutton,INPUT); digitalWrite(firstbutton, HIGH); digitalWrite(secondbutton, HIGH); digitalWrite(thirdbutton, HIGH); Serial.begin(9600); } void loop() { if (digitalRead(firstbutton) == LOW) { Serial.println('1'); } if (digitalRead(secondbutton) == LOW) { Serial.println('2'); } if (digitalRead(thirdbutton) == LOW) { Serial.println('3'); } else { // Serial.println("..."); } delay(500); }
on processing:
import processing.serial.*; import processing.video.*; Serial myCommChannel; //------------------Spread 1 Movie Bin------------------------------------------------------------ Movie wakeup01; Movie walktobathroom02; Movie waittoturnontap03; Movie turnontap04; Movie brushingteeth05; Movie turnofftap06; Movie outcome1A07; Movie outcome1B08; Movie continuewater09; Movie finishbrushteeth10; Movie walktoshower11; Movie waittohotandcold12; Movie outcomehot13; Movie outcomecold14; Movie shower15; Movie finishshower16; Movie waittopressswitch17; Movie pressswitch18; Movie outcome3A19; Movie outcome3B20; Movie goout21; //-------------------Spread 2 Movie Bin----------------------------------------------------------- Movie firstScene; Movie secondScene; Movie secondTwoScene; Movie thirdScene; Movie thirdTwoScene; Movie fourthScene; Movie fourthTwoScene; Movie fourthThreeScene; Movie fifthScene; Movie sixthScene; Movie sixthTwoScene; Movie sixthThreeScene; Movie seventhScene; Movie infoOne; Movie infoTwo; //--------------------Spread 3 Movie Bin---------------------------------------------------------- Movie reachhome_301; Movie sitdown_302; Movie waittopressremote_303; Movie pressremote_304; Movie watchtv_305; Movie walktofridge_306; Movie waittoopenfridge_307; Movie openfridge_308; Movie getfood_309; Movie outcomefridge_310; Movie waittoclosefridge_311; Movie closefridge_312; Movie walkbacktocouch_313; Movie yawn_314; Movie outcome1A_315; Movie outcome1B_316; Movie walktobedroom_317; Movie waittopressswitch_318; Movie outcome2A_319; Movie outcome2B_320; Movie gosleep_321; //--------------------Spread 1 Boolean---------------------------------------------------------- boolean wakeup101 = true; boolean walk102 = false; boolean waittap103 = false; boolean turntapon104 = false; boolean brushteeth105 = false; boolean turntapoff106 = false; boolean turntapoff106bad = false; boolean outcomebadwater107 = false; boolean outcomegoodwater108 = false; boolean continuewater109 = false; boolean finishbrush110 = false; boolean walktoshower111 = false; boolean waitheater112 = false; boolean outcomehot113 = false; boolean outcomecold114 = false; boolean shower115 = false; boolean finishshower116 = false; boolean waitswitch1117 = false; boolean pressswitch1118 = false; boolean pressswitch1118bad = false; boolean outcomebadlight119 = false; boolean outcomegoodlight120 = false; boolean goout121 = false; //-------------------Spread 2 Boolean---------------------------------------------------------- boolean firstPlaying = false; boolean secondPlaying = false; boolean secondTwoPlaying = false; boolean thirdPlaying = false; boolean thirdTwoPlaying = false; boolean fourthPlaying = false; boolean fourthTwoPlaying = false; boolean fourthThreePlaying = false; boolean fifthPlaying = false; boolean sixthPlaying = false; boolean infoOnePlaying = false; boolean infoTwoPlaying = false; boolean sixthTwoPlaying = false; boolean sixthThreePlaying = false; boolean seventhPlaying = false; //-------------------Spread 3 Boolean----------------------------------------------------------- boolean gohome_3301 = false; boolean sitdown_3302 = false; boolean waitremote_3303 = false; boolean pressremote_3304 = false; boolean watchtv_3305 = false; boolean walktofridge_3306 = false; boolean waitfridge_3307 = false; boolean openfridge_3308 = false; boolean getfood_3309 = false; boolean outcomefridge_3310 = false; boolean waitfridgeclose_3311 = false; boolean closefridge_3312 = false; boolean walkback_3313 = false; boolean yawn_3314 = false; boolean waitremoteoff_3315 = false; boolean pressremoteoff_3316 = false; boolean pressremoteoff_3316bad = false; boolean outcomebadremote_3317 = false; boolean outcomegoodremote_3318 = false; boolean walktobed_3319 = false; boolean waitswitch3_3320 = false; boolean pressswitch3_3321 = false; boolean pressswitch3_3321bad = false; boolean outcomebadswitch_3322 = false; boolean outcomegoodswitch_3323 = false; boolean gosleep_3324 = false; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ char inputChar = '?'; int myTime0101; int myTime0102; int myTime0103; int myTime0201; int myTime0202; int myTime0203; int myTime0301; int myTime0302; int myTime0303; int waitTime = 10000; void setup() { //size(1080,1920); size(480, 960); //fullScreen(); surface.setResizable(true); //printArray(Serial.list()); myCommChannel = new Serial(this, Serial.list()[3], 9600); //----------------Define Spread 1 Movie-------------------------------------------------------------- wakeup01 = new Movie(this, "02_02_01.mp4"); walktobathroom02 = new Movie(this, "02_02_02.mp4"); waittoturnontap03 = new Movie(this, "02_02_03.mp4"); turnontap04 = new Movie(this, "02_03_01.mp4"); brushingteeth05 = new Movie (this, "02_03_02.mp4"); turnofftap06 = new Movie(this, "02_04_01.mp4"); outcome1A07 = new Movie(this, "02_04_02.mp4"); outcome1B08 = new Movie(this, "02_04_03.mp4"); continuewater09 = new Movie(this, "02_05.mp4"); finishbrushteeth10 = new Movie(this, "02_06_01.mp4"); walktoshower11 = new Movie(this, "02_06_02.mp4"); waittohotandcold12 = new Movie(this, "02_06_03.mp4"); outcomehot13 = new Movie(this, "02_07.mp4"); outcomecold14 = new Movie(this, "infoOne.mp4"); shower15 = new Movie(this, "infoTwo.mp4"); finishshower16 = new Movie(this, "infoTwo.mp4"); waittopressswitch17 = new Movie(this, "infoTwo.mp4"); pressswitch18 = new Movie(this, "infoTwo.mp4"); outcome3A19 = new Movie(this, "infoTwo.mp4"); outcome3B20 = new Movie(this, "infoTwo.mp4"); goout21 = new Movie(this, "infoTwo.mp4"); //-----------------Define Spread 2 Movie------------------------------------------------------------- firstScene = new Movie(this, "02_02_01.mp4"); secondScene = new Movie(this, "02_02_02.mp4"); secondTwoScene = new Movie(this, "02_02_03.mp4"); thirdScene = new Movie(this, "02_03_01.mp4"); thirdTwoScene = new Movie (this, "02_03_02.mp4"); fourthScene = new Movie(this, "02_04_01.mp4"); fourthTwoScene = new Movie(this, "02_04_02.mp4"); fourthThreeScene = new Movie(this, "02_04_03.mp4"); fifthScene = new Movie(this, "02_05.mp4"); sixthScene = new Movie(this, "02_06_01.mp4"); sixthTwoScene = new Movie(this, "02_06_02.mp4"); sixthThreeScene = new Movie(this, "02_06_03.mp4"); seventhScene = new Movie(this, "02_07.mp4"); infoOne = new Movie(this, "infoOne.mp4"); infoTwo = new Movie(this, "infoTwo.mp4"); //---------------Define Spread 3 Movie--------------------------------------------------------------- reachhome_301 = new Movie(this, "02_02_01.mp4"); sitdown_302 = new Movie(this, "02_02_02.mp4"); waittopressremote_303 = new Movie(this, "02_02_03.mp4"); pressremote_304 = new Movie(this, "02_03_01.mp4"); watchtv_305 = new Movie (this, "02_03_02.mp4"); walktofridge_306 = new Movie(this, "02_04_01.mp4"); waittoopenfridge_307 = new Movie(this, "02_04_02.mp4"); openfridge_308 = new Movie(this, "02_04_03.mp4"); getfood_309 = new Movie(this, "02_05.mp4"); outcomefridge_310 = new Movie(this, "02_06_01.mp4"); waittoclosefridge_311 = new Movie(this, "02_06_02.mp4"); closefridge_312 = new Movie(this, "02_06_03.mp4"); walkbacktocouch_313 = new Movie(this, "02_07.mp4"); yawn_314 = new Movie(this, "infoOne.mp4"); outcome1A_315 = new Movie(this, "infoTwo.mp4"); outcome1B_316 = new Movie(this, "infoTwo.mp4"); walktobedroom_317 = new Movie(this, "infoTwo.mp4"); waittopresswitch_318 = new Movie(this, "infoTwo.mp4"); outcome2A_319 = new Movie(this, "infoTwo.mp4"); outcome2B_320 = new Movie(this, "infoTwo.mp4"); gosleep_321 = new Movie(this, "infoTwo.mp4"); } void draw() { //background (70); //printArray(Serial.list()); inputChar = myCommChannel.readChar(); //-------------------SPREAD 1--------------------------------------------------- //------------------------------------------------------------------------------ if (wakeup101) { play101(); } if (walk102) { play102(); } if (waittap103) { play103(); } if (turntapon104) { play104(); } if (brushteeth105) { play105(); } if (turntapoff106) { play106(); } if (turntapoff106bad) { play106bad(); } if (outcomebadwater107) { play107(); } if (outcomegoodwater108) { play108(); } if (continuewater109) { play109(); } if (finishbrush110) { play110(); } if (walktoshower111) { play111(); } if (waitheater112) { play112(); } if (outcomehot113) { play113(); } if (outcomecold114) { play114(); } if (shower115) { play115(); } if (finishshower116) { play116(); } if (waitswitch1117) { play117(); } if (pressswitch1118) { play118(); } if (pressswitch1118bad) { play118bad(); } if (outcomebadlight119) { play119(); } if (outcomegoodlight120) { play120(); } if (goout121) { play121(); } //-------------------SPREAD 2--------------------------------------------------- //------------------------------------------------------------------------------ if (firstPlaying) { playFirstScene(); } if (secondPlaying) { playSecondScene(); } if (secondTwoPlaying) { playSecondTwoScene(); } if (thirdPlaying) { playThirdScene(); } if (thirdTwoPlaying) { playThirdTwoScene(); } if (fourthPlaying) { playFourthScene(); } if (fourthTwoPlaying) { playFourthTwoScene(); } if (fourthThreePlaying) { playFourthThreeScene(); } if (fifthPlaying) { playFifthScene(); } if (sixthPlaying) { playSixthScene(); } if (infoOnePlaying) { playInfoOne(); } if (sixthTwoPlaying) { playSixthTwoScene(); } if (infoTwoPlaying) { playInfoTwo(); } if (sixthThreePlaying) { playSixthThreeScene(); } if (seventhPlaying) { playSeventhScene(); } //-------------------SPREAD 3--------------------------------------------------- //------------------------------------------------------------------------------ if (gohome_3301) { play301(); } if (sitdown_3302) { play302(); } if (waitremote_3303) { play303(); } if (pressremote_3304) { play304(); } if (watchtv_3305) { play305(); } if (walktofridge_3306) { play306(); } if (waitfridge_3307) { play307(); } if (openfridge_3308) { play308(); } if (getfood_3309) { play309(); } if (outcomefridge_3310) { play310(); } if (waitfridgeclose_3311) { play311(); } if (closefridge_3312) { play312(); } if (walkback_3313) { play313(); } if (yawn_3314) { play314(); } if (waitremoteoff_3315) { play315(); } if (pressremoteoff_3316) { play316(); } if (pressremoteoff_3316bad) { play316bad(); } if (outcomebadremote_3317) { play317(); } if (outcomegoodremote_3318) { play318(); } if (walktobed_3319) { play319(); } if (waitswitch3_3320) { play320(); } if (pressswitch3_3321) { play321(); } if (pressswitch3_3321bad) { play321bad(); } if (outcomebadswitch_3322) { play322(); } if (outcomegoodswitch_3323) { play323(); } if (gosleep_3324) { play324(); } } //-------------------SPREAD 1--------------------------------------------------- //------------------------------------------------------------------------------ void play101() { wakeup01.play(); image(wakeup01, 0, 0, width, height); if (wakeup01.time() >= wakeup01.duration()-0.3 ) { wakeup01.stop(); wakeup101 = false; walk102 = true; } } void play102() { walktobathroom02.play(); image(walktobathroom02, 0, 0, width, height); if (walktobathroom02.time() >= walktobathroom02.duration()-0.3 ) { walktobathroom02.stop(); walk102 = false; waittap103 = true; } } void play103() { waittoturnontap03.loop(); image(waittoturnontap03, 0, 0, width, height); switch (inputChar) { case 51: waittoturnontap03.stop(); waittap103=false; turntapon104 = true; } } void play104() { turnontap04.play(); image(turnontap04, 0, 0, width, height); if (turnontap04.time() >= turnontap04.duration()-0.3 ) { turnontap04.stop(); turntapon104 = false; startCounting1One(); brushteeth105 = true; } } void startCounting1One() { myTime0101 = millis(); } void play105() { brushingteeth05.loop(); image(brushingteeth05, 0, 0, width, height); if (millis() - myTime0101 >= waitTime) { brushingteeth05.stop(); brushteeth105=false; outcomebadwater107 = true; } switch (inputChar) { case 49: brushingteeth05.stop(); brushteeth105=false; turntapoff106 = true; } } void play106() { turnofftap06.play(); image(turnofftap06, 0, 0, width, height); if (turnofftap06.time() >= turnofftap06.duration()-0.3 ) { turnofftap06.stop(); turntapoff106 = false; outcomegoodwater108 = true; } } void play107() { outcome1A07.loop(); image(outcome1A07, 0, 0, width, height); switch (inputChar) { case 49: outcome1A07.stop(); outcomebadwater107=false; turntapoff106bad = true; } } void play106bad() { turnofftap06.play(); image(turnofftap06, 0, 0, width, height); if (turnofftap06.time() >= turnofftap06.duration()-0.3 ) { turnofftap06.stop(); turntapoff106 = false; continuewater109 = true; } } void play108() { outcome1B08.play(); image(outcome1B08, 0, 0, width, height); if (outcome1B08.time() >= outcome1B08.duration()-0.3 ) { outcome1B08.stop(); outcomegoodwater108 = false; continuewater109 = true; } } void play109() { continuewater09.play(); image(continuewater09, 0, 0, width, height); if (continuewater09.time() >= continuewater09.duration()-0.3 ) { continuewater09.stop(); continuewater109 = false; finishbrush110 = true; } } void play110() { finishbrushteeth10.play(); image(finishbrushteeth10, 0, 0, width, height); if (finishbrushteeth10.time() >= finishbrushteeth10.duration()-0.3 ) { finishbrushteeth10.stop(); finishbrush110 = false; walktoshower111 = true; } } void play111() { walktoshower11.play(); image(walktoshower11, 0, 0, width, height); if (walktoshower11.time() >= walktoshower11.duration()-0.3 ) { walktoshower11.stop(); walktoshower111 = false; waitheater112 = true; } } void play112() { waittohotandcold12.loop(); image(waittohotandcold12, 0, 0, width, height); switch (inputChar) { case 49: waittohotandcold12.stop(); waitheater112=false; startCounting1Two(); outcomehot113 = true; case 51: waittohotandcold12.stop(); waitheater112=false; startCounting1Two(); outcomecold114 = true; } } void startCounting1Two() { myTime0102 = millis(); } void play113() { outcomehot13.loop(); image(outcomehot13, 0, 0, width, height); if (millis() - myTime0102 >= waitTime) { outcomehot13.stop(); outcomehot113=false; shower115 = true; } } void play114() { outcomecold14.loop(); image(outcomecold14, 0, 0, width, height); if (millis() - myTime0102 >= waitTime) { outcomecold14.stop(); outcomecold114=false; shower115 = true; } } void play115() { shower15.play(); image(shower15, 0, 0, width, height); if (shower15.time() >= shower15.duration()-0.3 ) { shower15.stop(); shower115 = false; finishshower116 = true; } } void play116() { finishshower16.play(); image(finishshower16, 0, 0, width, height); if (finishshower16.time() >= finishshower16.duration()-0.3 ) { finishshower16.stop(); finishshower116 = false; startCounting1Three(); waitswitch1117 = true; } } void startCounting1Three() { myTime0103 = millis(); } void play117() { waittopressswitch17.loop(); image(waittopressswitch17, 0, 0, width, height); if (millis() - myTime0103 >= waitTime) { waittopressswitch17.stop(); waitswitch1117=false; outcomebadlight119 = true; } switch (inputChar) { case 49: waittopressswitch17.stop(); waitswitch1117=false; pressswitch1118 = true; } } void play118() { pressswitch18.play(); image(pressswitch18, 0, 0, width, height); if (pressswitch18.time() >= pressswitch18.duration()-0.3 ) { pressswitch18.stop(); pressswitch1118 = false; outcomegoodlight120 = true; } } void play119() { outcome3A19.loop(); image(outcome3A19, 0, 0, width, height); switch (inputChar) { case 49: outcome3A19.stop(); outcomebadlight119=false; pressswitch1118bad = true; } } void play118bad() { pressswitch18.play(); image(pressswitch18, 0, 0, width, height); if (pressswitch18.time() >= pressswitch18.duration()-0.3 ) { pressswitch18.stop(); pressswitch1118bad = false; goout121 = true; } } void play120() { outcome3B20.play(); image(outcome3B20, 0, 0, width, height); if (outcome3B20.time() >= outcome3B20.duration()-0.3 ) { outcome3B20.stop(); outcomegoodlight120 = false; goout121 = true; } } void play121() { goout21.play(); image(goout21, 0, 0, width, height); if (goout21.time() >= goout21.duration()-0.3 ) { goout21.stop(); goout121 = false; //goout121 = true; } } //-------------------SPREAD 2--------------------------------------------------- //------------------------------------------------------------------------------ void playFirstScene() { firstScene.play(); image(firstScene, 0, 0, width, height); if (firstScene.time() >= firstScene.duration()-0.3 ) { firstScene.stop(); firstPlaying = false; secondPlaying = true; } } void playSecondScene() { secondScene.play(); image(secondScene, 0, 0, width, height); if (secondScene.time() >= secondScene.duration()-0.3) { secondScene.stop(); secondPlaying = false; secondTwoPlaying = true; } } void playSecondTwoScene() { secondTwoScene.play(); image(secondTwoScene, 0, 0, width, height); if (secondTwoScene.time() >= secondTwoScene.duration()-0.3) { secondTwoScene.stop(); secondTwoPlaying = false; thirdPlaying = true; } } void playThirdScene() { thirdScene.loop(); image(thirdScene, 0, 0, width, height); switch (inputChar) { case 49: thirdScene.stop(); thirdPlaying=false; thirdTwoPlaying = true; } } void playThirdTwoScene() { thirdTwoScene.play(); image(thirdTwoScene, 0, 0, width, height); if (thirdTwoScene.time() >= thirdTwoScene.duration()-0.3) { thirdTwoScene.stop(); thirdTwoPlaying=false; fourthPlaying = true; } } void playFourthScene() { fourthScene.loop(); image(fourthScene, 0, 0, width, height); switch (inputChar) { case 50: fourthScene.stop(); fourthPlaying=false; fourthTwoPlaying = true; } } void playFourthTwoScene() { fourthTwoScene.play(); image(fourthTwoScene, 0, 0, width, height); if (fourthTwoScene.time() >= fourthTwoScene.duration()-0.3) { fourthTwoScene.stop(); fourthTwoPlaying=false; fourthThreePlaying = true; } } void playFourthThreeScene() { fourthThreeScene.play(); image(fourthThreeScene, 0, 0, width, height); if (fourthThreeScene.time() >= fourthThreeScene.duration()-0.3) { fourthThreeScene.stop(); fourthThreePlaying=false; fifthPlaying = true; } } void playFifthScene() { fifthScene.play(); image(fifthScene, 0, 0, width, height); if (fifthScene.time() >= fifthScene.duration()-0.3) { fifthScene.stop(); fifthPlaying=false; startCounting2(); //println(myTime); sixthPlaying = true; } } void startCounting2() { myTime0201 = millis(); } void playSixthScene() { sixthScene.loop(); image(sixthScene, 0, 0, width, height); if (millis() - myTime0201 >= waitTime) { sixthScene.stop(); sixthPlaying=false; startCounting2Two(); infoOnePlaying = true; println("this is detected"); } switch (inputChar) { case 51: sixthScene.stop(); sixthPlaying=false; sixthTwoPlaying = true; println("good"); } } void startCounting2Two() { myTime0202 = millis(); } void playInfoOne() { println("playing info one"); infoOne.loop(); image(infoOne, 0, 0, width, height); if (millis() - myTime0202 >= waitTime) { infoOne.stop(); infoOnePlaying=false; sixthThreePlaying = true; } } void playSixthTwoScene() { sixthTwoScene.play(); image(sixthTwoScene, 0, 0, width, height); if (sixthTwoScene.time() >= sixthTwoScene.duration()-0.3) { sixthTwoScene.stop(); sixthTwoPlaying = false; startCounting2Three(); infoTwoPlaying = true; } } void startCounting2Three() { myTime0203 = millis(); } void playInfoTwo() { infoTwo.loop(); image(infoTwo, 0, 0, width, height); if (millis() - myTime0203 >= waitTime) { infoTwo.stop(); infoTwoPlaying=false; sixthThreePlaying = true; } } void playSixthThreeScene() { sixthThreeScene.play(); image(sixthThreeScene, 0, 0, width, height); if (sixthThreeScene.time() >= sixthThreeScene.duration()-0.3) { sixthThreeScene.stop(); sixthThreePlaying = false; seventhPlaying = true; } } void playSeventhScene() { seventhScene.play(); image(seventhScene, 0, 0, width, height); if (seventhScene.time() >= seventhScene.duration()-0.3) { seventhScene.stop(); seventhPlaying=false; //firstPlaying = true; } } //-------------------SPREAD 3--------------------------------------------------- //------------------------------------------------------------------------------ void play301() { reachhome_301.play(); image(reachhome_301, 0, 0, width, height); if (reachhome_301.time() >= reachhome_301.duration()-0.3 ) { reachhome_301.stop(); gohome_3301 = false; sitdown_3302 = true; } } void play302() { sitdown_302.play(); image(sitdown_302, 0, 0, width, height); if (sitdown_302.time() >= sitdown_302.duration()-0.3 ) { sitdown_302.stop(); sitdown_3302 = false; waitremote_3303 = true; } } void play303() { waittopressremote_303.loop(); image(waittopressremote_303, 0, 0, width, height); switch (inputChar) { case 50: waittopressremote_303.stop(); waitremote_3303=false; pressremote_3304 = true; } } void play304() { pressremote_304.play(); image(pressremote_304, 0, 0, width, height); if (pressremote_304.time() >= pressremote_304.duration()-0.3 ) { pressremote_304.stop(); pressremote_3304 = false; watchtv_3305 = true; } } void play305() { watchtv_305.play(); image(watchtv_305, 0, 0, width, height); if (watchtv_305.time() >= watchtv_305.duration()-0.3 ) { watchtv_305.stop(); watchtv_3305 = false; walktofridge_3306 = true; } } void play306() { walktofridge_306.play(); image(walktofridge_306, 0, 0, width, height); if (walktofridge_306.time() >= walktofridge_306.duration()-0.3 ) { walktofridge_306.stop(); walktofridge_3306 = false; waitfridge_3307 = true; } } void play307() { waittoopenfridge_307.loop(); image(waittoopenfridge_307, 0, 0, width, height); switch (inputChar) { case 50: waittoopenfridge_307.stop(); waitfridge_3307=false; openfridge_3308 = true; } } void play308() { openfridge_308.play(); image(openfridge_308, 0, 0, width, height); if (openfridge_308.time() >= openfridge_308.duration()-0.3 ) { openfridge_308.stop(); openfridge_3308 = false; getfood_3309 = true; } } void play309() { getfood_309.play(); image(getfood_309, 0, 0, width, height); if (getfood_309.time() >= getfood_309.duration()-0.3 ) { getfood_309.stop(); getfood_3309 = false; startCounting3One(); outcomefridge_3310 = true; } } startCounting3One() { myTime0301 = millis(); } void play310() { outcomefridge_301.loop(); image(outcomefridge_301, 0, 0, width, height); if (millis() - myTime0301 >= waitTime) { outcomefridge_301.stop(); outcomefridge_3310=false; waitfridgeclose_3311 = true; } } void play311() { waittoclosefridge_311.loop(); image(waittoclosefridge_311, 0, 0, width, height); switch (inputChar) { case 50: waittoclosefridge_311.stop(); waitfridgeclose_3311=false; closefridge_3312 = true; } } void play312() { closefridge_312.play(); image(closefridge_312, 0, 0, width, height); if (closefridge_312.time() >= closefridge_312.duration()-0.3 ) { closefridge_312.stop(); closefridge_3312 = false; walkback_3313 = true; } } void play313() { walkbacktocouch_313.play(); image(walkbacktocouch_313, 0, 0, width, height); if (walkbacktocouch_313.time() >= walkbacktocouch_313.duration()-0.3 ) { walkbacktocouch_313.stop(); walkback_3313 = false; yawn_3314 = true; } } void play314() { yawn_314.play(); image(yawn_314, 0, 0, width, height); if (yawn_314.time() >= yawn_314.duration()-0.3 ) { yawn_314.stop(); yawn_3314 = false; startCounting3Two(); waitremoteoff_3315 = true; } } void startCounting3Two() { myTime0302 = millis(); } void play315() { waittopressremote_303.loop(); image(waittopressremote_303, 0, 0, width, height); if (millis() - myTime0302 >= waitTime) { waittopressremote_303.stop(); waitremoteoff_3315=false; outcomebadremote_3317 = true; } switch (inputChar) { case 49: waittopressremote_303.stop(); waitremoteoff_3315 = false; pressremoteoff_3316 = true; } } void play316() { pressremote_3304.play(); image(pressremote_3304, 0, 0, width, height); if (pressremote_3304.time() >= pressremote_3304.duration()-0.3 ) { pressremote_3304.stop(); pressremoteoff_3316 = false; startCounting3Three(); outcomegoodremote_3318 = true; } } void startCounting3Three() { myTime0303 = millis(); } void play317() { outcome1A_315.loop(); image(outcome1A_315, 0, 0, width, height); switch (inputChar) { case 50: outcome1A_315.stop(); outcomebadremote_3317 =false; pressremoteoff_3316bad = true; } } void play316bad() { pressremote_304.play(); image(pressremote_304, 0, 0, width, height); if (pressremote_304.time() >= pressremote_304.duration()-0.3 ) { pressremote_304.
PROGRESS
08/09/2018 at 01:17 • 0 commentsWEEK 9
WEEK 10
26/7
- Acrylic arrives.
- Work on pepper-ghost.
- Work on physical book.
- Get the code to work.
- Work on animations.
- Sounds.
27/7
- LED arrives.
- Finish narration + storyline.
- Second attempt on test print book graphics.
- Add in instructions + sound effects in animations.
WEEK 11
30/7
- Group discussion on Discord.
- -
- -
- -
- -
BLUEPRINT
08/08/2018 at 19:46 • 0 commentsWEEK 8
9/7
- Sketch out.
- Start on structure technical drawing.
- Second attempt on prototyping pepper-ghost.
- Test out graphics on hologram.
- Finish 02 animation.
10/7
- Discuss on Discord.
- 50% finished on 02 animation.
11/7
- Finish technical drawing.
- Send blueprint + inform Zaimi (Sunway Workshop).
- 02 animation has yet to be finished.
12/7
- Measure size of 41-inch TV.
- Meet up + discuss with Zaimi (Sunway Workshop) about structure.
- Make changes + fix structure design (add: door, lock, height).
- Plan on exterior design (graphic, colour, material, sticker? spray paint?).
13/7
- 02 animation finished (roughly).
- Work on 01 animation.
14/7
- Check on graphics, animations & structure designs.
16/7
- Update on structure orthographic blueprint.
PLANNING + PROTOTYPING
08/08/2018 at 18:43 • 0 commentsWEEK 7
JOBS ASSIGN:
- Illustrator : Kok Wei (Art Director)
- Animator : Justin
- Structure : Rendy
- Book : Sabrina (Logistics)
- Coding : Steffie (Overall)
29/6
- Continue to work on graphics.
- Research on interactable buttons & sensors.
- Research on structure building.
2/7
- Discuss finalized interactions.
3/7
- Discuss on Discord: Graphics, structure, interactable items.
4/7
- Meet up with Johnathan (lecturer).
- Discuss about animation structure.
5/7
- Update graphics & animations.
- First attempt on prototyping pepper-ghost.
- Adjust animation's dimension to fit in pepper-ghost.
- Plan on structure design.
6/7
- Apply for TV.
- Search for structure materials.
SHOPPING LIST:
- LED Strip (1m)
- Acrylic
- Foam Board
- Paper Board
- Plywood
- Wire
- Screw
MEGA PROJECT UPDATE
08/05/2018 at 12:16 • 0 commentsIt's been long weeks!
Final Pitch presented to client on 28/6 (attached as DI_FinalPitch) concluded:
- further refining needed for the supporting structures
- attract-ability of tangible interactions
- idea seems interesting and plausible
Throughout the hiatus of these logs, there have been many major changes and updates to the project, including:
- prototype of pepper ghost
- materials used for the flipbook
- mechanism
ePitch #1 – Summary
06/22/2018 at 11:01 • 0 commentsfirst pitch to client;
no significant weight on the scale, both ideas have the heavy pros and cons.
what's next:
- having internal session to identify the problems (it remained unsolved) we faced throughout the process up to this point
- seek advice from lecturers
- had some help in brainstorming
----------------------------------------------------------------------------------------------------------------------------------------
IdeaBin – Update #5
06/09/2018 at 18:55 • 0 commentsoptional discussion summary:
- 5 hours of nothingness
- no significant conclusion obtained; and when all hope is lost,
- discovered a rather intriguing and workable idea, although it's just been given birth to, we're optimistic about it, but don't know what lecturers have to say about it
- idea to refine is doing fine, only minor adjustments of the pitch is needed because lacking of clarity on the previous pitch, most of the adjustment were initially there, but not well-presented
what's next:
- make a pitch deck for (11/6)
- refine and enhance the newborn baby idea
- ask for advices regarding the new idea from lecturers
- inform the other group members about the newborn
----------------------------------------------------------------------------------------------------------------------------------------