{"id":12373,"date":"2022-11-28T13:32:09","date_gmt":"2022-11-28T18:32:09","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/?p=12373"},"modified":"2023-06-06T10:09:40","modified_gmt":"2023-06-06T14:09:40","slug":"flux-project-2-documentation","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/flux-project-2-documentation\/","title":{"rendered":"Flux &#8211; Project 2 Documentation"},"content":{"rendered":"<p>Documentation<\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12385\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-300x169.png\" alt=\"\" width=\"1083\" height=\"610\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-300x169.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-1024x576.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-768x432.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-1536x864.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-973x547.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title-508x286.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/FeatureImage-and-Project-Title.png 1920w\" sizes=\"(max-width: 1083px) 100vw, 1083px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12394 \" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-300x169.png\" alt=\"\" width=\"1083\" height=\"610\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-300x169.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-1024x576.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-768x432.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-1536x864.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-2048x1152.png 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-973x547.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Narrative-and-Descriptions-3-508x286.png 508w\" sizes=\"(max-width: 1083px) 100vw, 1083px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12390\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-300x300.png\" alt=\"\" width=\"1087\" height=\"1087\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-1024x1024.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-768x768.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-1536x1536.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-88x88.png 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-973x973.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-508x508.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1.png 1920w\" sizes=\"(max-width: 1087px) 100vw, 1087px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12391\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-300x300.png\" alt=\"\" width=\"1073\" height=\"1073\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-1024x1024.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-768x768.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-1536x1536.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-88x88.png 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-973x973.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2-508x508.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos2.png 1920w\" sizes=\"(max-width: 1073px) 100vw, 1073px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12387\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-300x300.png\" alt=\"\" width=\"1091\" height=\"1091\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-1024x1024.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-768x768.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-1536x1536.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-2048x2048.png 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-88x88.png 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-973x973.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images1-2-508x508.png 508w\" sizes=\"(max-width: 1091px) 100vw, 1091px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12388\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-300x300.png\" alt=\"\" width=\"1080\" height=\"1080\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-300x300.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-1024x1024.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-150x150.png 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-768x768.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-1536x1536.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-88x88.png 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-973x973.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2-508x508.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Progress-Images2.png 1920w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/p>\n<p><strong>PROGRESS REFLECTION<\/strong><\/p>\n<p>The entire idea is from my ambition to expand the interaction to two person. I started the project from aiming to create a fun &amp; spatial experience between people and environment. To fulfill this goal, certain design considerations come to mind that guide me throughout the whole process.<\/p>\n<p>1. The time-based painting needs to be large enough to be seen.<br \/>\nBy fulfilling this idea, me and Zach made a large easel from scratch. Marking, cutting, and mounting all the woods took us hours. However, this is a great learning process in that I knew how to use machines in the woodshops.<br \/>\nTo create an experience of time, the paper roll was then mounted onto the easel and by manually pulling down when needed, it dropped onto a certain height, and being clamped to the easel.<\/p>\n<p>2. The influx of colors are controllable.<br \/>\nI proceeded to test out the paint texture. The water-ish color flows too fast, which is harder to control, but the acrylic paint has higher viscosity that is more difficult to pump. After testing, I found that acrylic paint has heavier texture, which can be easier to control if we have a robust pump. Also, mixing a little water into the color will make the acrylic paint more fluidic.<br \/>\nWhen finding the pump that fits, I was trying to find excellent pumps from Amazon, but later I found out that IDEATE has lots of 12V pumps for lending that are also robust enough.<\/p>\n<p>3. Color Mixture looks like a painting that has certain aesthetic.<br \/>\nI was experimenting on multiple color mixture ideas. The initial idea was just doing red and blue mixture &#8212; which turns purple only. Then, I found that more color variation could lead to more vibrance and dynamic effect. In the setup, there are three colors mixing together (red, blue, yellow), and there are six kinds of color possibilities each with multiple levels of mixture (red, blue, yellow, green, purple, orange).<\/p>\n<p>4. The control of pumps on the painting are dependent on their distance between each other.<br \/>\nTo capture the distance of two people, I used 8 ultrasonic sensors, with each sending signal to one pump. Mounting all the hardwares and manage the wiring + tubing is a super time-consuming process.<br \/>\nThough not managed to calibrate to a \u201cworking\u201d state, I got all the required setups (code+hardware).<\/p>\n<p><strong>Things that was hard:<\/strong><br \/>\nSetting Mechanics up: This took me an entire weekend. First I drew out the schematics, and try to produce a small demo before mounting. Then, the tedius part comes: I individually glued the pumps, sensors, breadboards, and Arduino to the Easel. Then, the wiring process requires a crystal clear mind to avoid making mistakes. Also, there are risks that things are burned. I nearly damaged all the hardwares because one time I was testing, the power supply immediately goes to 21V when turned on. I could even see smokes. All the lession learnt is to Stay Alert.<br \/>\nCleaning: Thanks to the help from Zach and Erin, I was able to clean up the space after the presentation. The thing that I need to keep in mind in the future is to prepare for the mess beforehand (such as papers, napkins etc.), so that I will not spend lots of time wiping the floor and the table.<\/p>\n<p><strong>Things that I learned:<\/strong><br \/>\nThe installation process requires a huge amount of time and energy, and might result in lots of errors, so plan ahead and leave space for fixing \/ calibrating would be super important.<br \/>\nThe presentation was &#8212; a physical MESS. Although my audience\u2019s feedback was that seeing the pumps creating an unexpected effect was fun, I personally was not satisfied because the idea is to \u201ccontrol\u201d my hardware to not go crazy. Before the next presentation (final show), one thing I should do is to make sure all the pumps work correctly, and the color will not be disrupting. But this could be a thing learnt as well: you never know how the final things turn out to be and how the intended effect and the actual one could be.<\/p>\n<p>Finally, this is still a work-in-progess project that I can\u2019t wait to iterate on!<\/p>\n<p>&nbsp;<\/p>\n<p>Video<\/p>\n<p>(This are just detailed shots of the set-up and not Working Demos!!! &#8211; Please wait for the final show :))<\/p>\n<p><iframe loading=\"lazy\" title=\"62362 Project2-documentation\" width=\"620\" height=\"349\" src=\"https:\/\/www.youtube.com\/embed\/S_u-yrlV3Bs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/FLUX\r\n\/\/This is the Arduino Code for operating the interactive painting setups. Pin assignment is listed below.\r\n \r\n#include &lt;NewPing.h&gt;\r\nint myArray1[20];\r\nint myArray2[20];\r\nint myArray3[20];\r\nint myArray4[20];\r\nint myArray5[20];\r\nint myArray6[20];\r\nint myArray7[20];\r\nint myArray8[20];\r\nint sensorValue[8] = {0,0,0,0,0,0,0,0};\r\n\r\nint counter1 = 0;\r\nint counter2 = 0;\r\nint counter3 = 0;\r\nint counter4 = 0;\r\nint counter5 = 0;\r\nint counter6 = 0;\r\nint counter7 = 0;\r\nint counter8 = 0;\r\n\r\nint rawValue1;\r\nint rawValue2;\r\nint rawValue3;\r\nint rawValue4;\r\nint rawValue5;\r\nint rawValue6;\r\nint rawValue7;\r\nint rawValue8;\r\n\r\n\/\/Pin Mapping\r\nint pump1 = 6;\r\nint pump2 = 7;\r\nint pump3 = 8;\r\nint pump4 = 9;\r\nint pump5 = 10;\r\nint pump6 = 11;\r\nint pump7 = 12;\r\nint pump8 = 13;\r\n\r\nint pumpValue1 = 100; \/\/red\r\nint pumpValue2 = 100; \/\/blue\r\nint pumpValue3 = 100; \/\/red\r\nint pumpValue4 = 100; \/\/yellow\r\nint pumpValue5 = 100; \/\/yellow\r\nint pumpValue6 = 100; \/\/blue\r\nint pumpValue7 = 100; \/\/red\r\nint pumpValue8 = 100; \/\/blue\r\n\r\nint distance_two[2] = {0,0};\r\nint distance_pin[2] = {0,0};\r\n\r\n#define MAX_DISTANCE 200 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\r\n\r\n#define TRIGGER_PIN1  22  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN1     23  \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN2  24  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN2     25 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN3  26  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN3   27 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN4  28  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN4     29 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN5  30  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN5     31 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN6  32  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN6     33 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN7  34  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN7     35 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\n#define TRIGGER_PIN8  36  \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\r\n#define ECHO_PIN8     37 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\r\n\r\nNewPing sonar1(TRIGGER_PIN1, ECHO_PIN1, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar2(TRIGGER_PIN2, ECHO_PIN2, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar3(TRIGGER_PIN3, ECHO_PIN3, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar4(TRIGGER_PIN4, ECHO_PIN4, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar5(TRIGGER_PIN5, ECHO_PIN5, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar6(TRIGGER_PIN6, ECHO_PIN6, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar7(TRIGGER_PIN7, ECHO_PIN7, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\nNewPing sonar8(TRIGGER_PIN8, ECHO_PIN8, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\r\n\r\nvoid setup() {\r\n  pinMode(pump1, OUTPUT);\r\n  pinMode(pump2, OUTPUT);\r\n  pinMode(pump3, OUTPUT);\r\n  pinMode(pump4, OUTPUT);\r\n  pinMode(pump5, OUTPUT);\r\n  pinMode(pump6, OUTPUT);\r\n  pinMode(pump7, OUTPUT);\r\n  pinMode(pump8, OUTPUT);\r\n  Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\r\n}\r\n\r\nvoid loop() {\r\n  delay(500);                  \r\n\r\n\/\/-----get raw data-----\r\n  \r\n  rawValue1 = sonar1.ping_cm();\r\n\/\/  Serial.println(rawValue1);\r\n  if (rawValue1 &gt;0){\r\n  myArray1 [counter1] = rawValue1;\r\n  }\r\n  counter1 += 1;\r\n  if (counter1 &gt;= 20) {\r\n    counter1 = 0;\r\n  }\r\n  int allData1 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData1 = allData1 + myArray1[i];\r\n  }\r\n  int average1 = allData1 \/ 20;\r\n\/\/  Serial.println(average1);\r\n  sensorValue[0] = average1;\r\n\r\n\r\n  rawValue2 = sonar2.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue2 &gt;0){\r\n  myArray2 [counter2] = rawValue2;\r\n  }\r\n  counter2 += 1;\r\n  if (counter2 &gt;= 20) {\r\n    counter2 = 0;\r\n  }\r\n  int allData2 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData2 = allData2 + myArray2[i];\r\n  }\r\n  int average2 = allData2 \/ 20;\r\n\/\/  Serial.println(average2); \r\n  sensorValue[1] = average2;\r\n\r\n\r\n  rawValue3 = sonar3.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue3 &gt;0){\r\n  myArray3 [counter3] = rawValue3;\r\n  }\r\n  counter3 += 1;\r\n  if (counter3 &gt;= 20) {\r\n    counter3 = 0;\r\n  }\r\n  int allData3 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData3 = allData3 + myArray3[i];\r\n  }\r\n  int average3 = allData3 \/ 20;\r\n\/\/  Serial.println(average3); \r\n  sensorValue[2] = average3;\r\n\r\n\r\n  rawValue4 = sonar5.ping_cm(); \/\/sonar4 is broken\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue4 &gt;0){\r\n  myArray4 [counter4] = rawValue4;\r\n  }\r\n  counter4 += 1;\r\n  if (counter4 &gt;= 20) {\r\n    counter4 = 0;\r\n  }\r\n  int allData4 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData4 = allData4 + myArray4[i];\r\n  }\r\n  int average4 = allData4 \/ 20;\r\n\/\/  Serial.println(average4); \r\n  sensorValue[3] = average4;\r\n\r\n\r\n \r\n  rawValue5 = sonar5.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue5 &gt;0){\r\n  myArray5 [counter5] = rawValue5;\r\n  }\r\n  counter5 += 1;\r\n  if (counter5 &gt;= 20) {\r\n    counter5 = 0;\r\n  }\r\n  int allData5 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData5 = allData5 + myArray5[i];\r\n  }\r\n  int average5 = allData5 \/ 20;\r\n\/\/  Serial.println(average5); \r\n  sensorValue[4] = average5;\r\n\r\n\r\n \r\n  rawValue6 = sonar6.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue6 &gt;0){\r\n  myArray6 [counter6] = rawValue6;\r\n  }\r\n  counter6 += 1;\r\n  if (counter6 &gt;= 20) {\r\n    counter6 = 0;\r\n  }\r\n  int allData6 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData6 = allData6 + myArray6[i];\r\n  }\r\n  int average6 = allData6 \/ 20;\r\n\/\/  Serial.println(average6); \r\n  sensorValue[5] = average6;\r\n\r\n\r\n\r\n  rawValue7 = sonar7.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue7 &gt;0){\r\n  myArray7 [counter7] = rawValue7;\r\n  }\r\n  counter7 += 1;\r\n  if (counter7 &gt;= 20) {\r\n    counter7 = 0;\r\n  }\r\n  int allData7 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData7 = allData7 + myArray7[i];\r\n  }\r\n  int average7 = allData7 \/ 20;\r\n\/\/  Serial.println(average7); \r\n  sensorValue[6] = average7;\r\n\r\n\r\n  rawValue8 = sonar8.ping_cm();\r\n\/\/  Serial.println(rawValue2);\r\n  if (rawValue8 &gt;0){\r\n  myArray8 [counter8] = rawValue8;\r\n  }\r\n  counter8 += 1;\r\n  if (counter8 &gt;= 20) {\r\n    counter8 = 0;\r\n  }\r\n  int allData8 = 0;\r\n  for (int i = 0; i &lt;= 20; i++) {\r\n    allData8 = allData8 + myArray8[i];\r\n  }\r\n  int average8 = allData8 \/ 20;\r\n\/\/  Serial.println(average8); \r\n  sensorValue[7] = average8;\r\n\r\n\/\/Serial.print(sensorValue)\r\n\/\/Serial.println(average1); Serial.println(average2); Serial.println(average3); Serial.println(average4); Serial.println(average5);Serial.println(average6);Serial.println(average7);Serial.println(average8); \r\n\r\n\/\/-----set pump pin-----\r\n\/\/pump is from 100 to 255 \r\n\/\/ if distance &gt; x, red or blue pump is increased \r\n\r\n\/\/find smallest two vertical distance\r\n  int small_value1; \r\n  int small_value2;\r\n  int small_pin1; \/\/find sensor location\r\n  int small_pin2;\r\n  for (int i = 1; i &lt; 4; i++){\r\n    if (sensorValue[i] &lt; sensorValue[i-1]){\r\n      small_value1 = sensorValue[i];\r\n      small_pin1 = i+5;\r\n      }\r\n    }\r\n  for (int i = 5; i &lt; 8; i++){\r\n    if (sensorValue[i] &lt; sensorValue[i-1] &amp;&amp; i != small_pin1){\r\n      small_value2 = sensorValue[i];\r\n      small_pin2 = i+5;\r\n      }\r\n    }\r\n  \/\/Increase_Pump value\r\n  int pump_updated = 200;\r\n  \r\n  Serial.println(small_pin2,small_pin1);\r\n  \/\/color spreading out\r\n  analogWrite(small_pin1, pump_updated);\r\n  analogWrite(small_pin2, pump_updated);\r\n\r\n  \/\/-----send signal to pump-----\r\n  \/\/Mixing: more left - more red element, more right - more blue element\r\n  int pump_red = pumpValue1;\r\n  int pump_blue = pumpValue1;\r\n  int pumpArray[8] = {6,8,10,12};\r\n  for (int i = 0; i &lt; 8; i++){\r\n    if (i+6 != small_pin1 | i+6 != small_pin2){\r\n      analogWrite(i+6, pump_red);\r\n    }\r\n    pump_red = pump_red + 30;\r\n    }\r\n  int pumpArray[8] = {7,9,11,13};\r\n  for (int i = 0; i &lt; 8; i++){\r\n    if (i+6 != small_pin1 | i+6 != small_pin2){\r\n      analogWrite(i+6, pump_blue);\r\n    }\r\n    pump_blue = pump_blue - 30;\r\n    }\r\n\r\n\/\/Serial.println(small_pin1,small_pin2);Serial.println(small_value1,small_value2);\r\n \/\/analogWrite(pump1, pumpValue1);\r\n\/\/analogWrite(pump2, pumpValue2);\r\n\/\/analogWrite(pump3, pumpValue3);\r\n\/\/analogWrite(pump4, pumpValue4);\r\n\/\/analogWrite(pump5, pumpValue5);\r\n\/\/analogWrite(pump6, pumpValue6);\r\n\/\/analogWrite(pump7, pumpValue7);\r\n\/\/analogWrite(pump8, pumpValue8);\r\n\r\n}\r\n\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Documentation PROGRESS REFLECTION The entire idea is from my ambition to expand the interaction to two person. I started the project from aiming to create a fun &amp;&#8230;<\/p>\n","protected":false},"author":138,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[186],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12373"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/users\/138"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/comments?post=12373"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12373\/revisions"}],"predecessor-version":[{"id":12398,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12373\/revisions\/12398"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/media?parent=12373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/categories?post=12373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/tags?post=12373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}