{"id":12490,"date":"2022-12-16T17:36:07","date_gmt":"2022-12-16T22:36:07","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/?p=12490"},"modified":"2023-06-06T09:58:23","modified_gmt":"2023-06-06T13:58:23","slug":"pflux","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/pflux\/","title":{"rendered":"Documentation Flux+"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignnone wp-image-12491\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-300x225.png\" alt=\"\" width=\"1285\" height=\"964\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover.png 1689w\" sizes=\"(max-width: 1285px) 100vw, 1285px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12492\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover2-243x300.png\" alt=\"\" width=\"1286\" height=\"1588\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover2-243x300.png 243w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover2-768x947.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover2-508x626.png 508w\" sizes=\"(max-width: 1286px) 100vw, 1286px\" \/><\/p>\n<p><strong>Description \/ Narration:<\/strong><\/p>\n<p>Above viewers see a painting easel that allows them to co-create a visual representation of your interactions with it. The flow of colored ink through tubes mounted on the easel mixes and creates a painting on a paper roll. When viewer is standing nearby, or simply just passing-by, their horizontal position relative to the installation will be sent to the paint sets. This setup transduce the distance between viewer and the installation into a visual representation through the flow of colors, which can vary depending on the flow rates of the ink and the order in which the viewers enter the painting area. Tubes closest to you will have the quickest colors flow, and color sometimes mixes. There are three basic colors: red, blue, yellow, then are four color combinations available: red and blue, red and yellow, yellow and blue, and red and blue. Within a timeframe, such as one night, the viewers&#8217; activity will be documented on the paper through this color flows. The painting can be taken away by the viewers once the paper roll is pulled down and cut.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12496\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-300x225.png\" alt=\"\" width=\"1328\" height=\"996\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time1.png 1689w\" sizes=\"(max-width: 1328px) 100vw, 1328px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12497\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-300x225.png\" alt=\"\" width=\"1276\" height=\"957\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time2.png 1689w\" sizes=\"(max-width: 1276px) 100vw, 1276px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12498\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-300x225.png\" alt=\"\" width=\"1281\" height=\"961\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/time3.png 1689w\" sizes=\"(max-width: 1281px) 100vw, 1281px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12503\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-300x225.png\" alt=\"\" width=\"1283\" height=\"962\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/cover3-1.png 1689w\" sizes=\"(max-width: 1283px) 100vw, 1283px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Process Photo:<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"wp-image-12390 alignnone\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/11\/Well-Shot-Photos1-300x300.png\" alt=\"\" width=\"917\" height=\"917\" 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: 917px) 100vw, 917px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12495\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-300x225.png\" alt=\"\" width=\"1273\" height=\"955\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2.png 1689w\" sizes=\"(max-width: 1273px) 100vw, 1273px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12494\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-300x225.png\" alt=\"\" width=\"1277\" height=\"958\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process2-1.png 1689w\" sizes=\"(max-width: 1277px) 100vw, 1277px\" \/> <img loading=\"lazy\" class=\"alignnone wp-image-12493\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-300x225.png\" alt=\"\" width=\"1283\" height=\"962\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process1.png 1689w\" sizes=\"(max-width: 1283px) 100vw, 1283px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-12502\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-300x225.png\" alt=\"\" width=\"1283\" height=\"962\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4-508x381.png 508w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-content\/uploads\/2022\/12\/process4.png 1689w\" sizes=\"(max-width: 1283px) 100vw, 1283px\" \/><\/p>\n<p><strong>Process Reflection<\/strong><\/p>\n<div class=\"flex-1 overflow-hidden\">\n<div class=\"react-scroll-to-bottom--css-nfepb-79elbk h-full dark:bg-gray-800\">\n<div class=\"react-scroll-to-bottom--css-nfepb-1n7m0yu\">\n<div class=\"flex flex-col items-center text-sm h-full dark:bg-gray-800\">\n<div class=\"w-full border-b border-black\/10 dark:border-gray-900\/50 text-gray-800 dark:text-gray-100 group bg-gray-50 dark:bg-[#444654]\">\n<div class=\"text-base gap-6 m-auto md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0\">\n<div class=\"relative flex w-full flex-col lg:w-[calc(100%-115px)]\">\n<div class=\"flex flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose break-words dark:prose-invert light\">\n<p>In the process of building Flux, I struggled to integrate design + mechanical + computational, three elements effectively. I found it easy to come up with a concept, but integrating the mechanical components with fabrication, plus the computational aspect was much more challenging. In the project 2, there are several defects that I need to iterate on, which gives another layer of complexity to this final show.<\/p>\n<p>One of the hardest parts of the project was rebuilding the tube settings and calibrate the pumps and sensors. Last presentation, the tubes were not adjusted in a fixed location, so colors sprayed everywhere, and cleaning became a hard problem. This time, I undo, and reconnected all the tubings on the easel, with a better planned mounting steps. I always told myself to stay alert when dealing with the mechanics and fabrication, with the idea that fixing can take much longer than being careful. After the three hours preparation, the tubings finally sit correctly.<\/p>\n<p>The other part was the pumps and sensors, in which are more challenging. As I wanted to control the color flow without letting it went crazy, I re-tested its pwm prior to the show, and re-mounted them with lots of glues. However, this was just the first step. Calibrating the sensors so that they sent appropriate signals to the pump was another thing I tried hard. From rewritting the color arranging code, to testing the performance of the code with varying physical distance, I was managed to use eight sensors and guaranteed at least six would be working. Though this was a algorithmic aspect of the project, I believe this effort did contributed a lot to the performance of this artwork.\u00a0Looking back to my project 2, the aforementioned instances where I thought I had everything working correctly, only to realize there was an error somewhere that was causing the project to malfunction. Though last time was frustrating, this time I knew the importance of thorough testing and debugging. It became easier to integrate all the different elements and to troubleshoot any issues that arose.<\/p>\n<p>The show was amazing. People were attracted by the interesting flows of colors, as well as the creative paints generated through this interactive sets. In specific, during later part of the show, when the colors were richer on the paper, the painting looked magical. As some of them noticed the sensors, most of them were surprised by the concept of this piece. Though the preparation took a bit longer time than expected, I felt proud to my final work and grateful to everyone who made this happen. Thanks to the lighting, the other art pieces, and everyone, who made the night a poetic co-creation.<\/p>\n<p>Lastly, dealing with the leftover paints after the show taught me valuable skills in organization and patience. I had to disassemble most of the components I had built from scratch and carefully clean them one by one in the sink. It was a time-consuming and tiring process, but I felt a sense of accomplishment and responsibility for not only my own artwork, but for the entire show. Despite being the last student to leave the WQED studio, I left feeling satisfied and proud of the work I had put in. The experience reinforced the importance of being organized and taking care of my surroundings.<\/p>\n<p>Overall, this project was a great learning experience. It pushed me to learn new skills and taught me the importance of careful planning and thorough testing. I&#8217;m excited to apply what I learned to future projects and to continue growing as a creative and technical thinker.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Video Demonstration:<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"Flux\" width=\"620\" height=\"349\" src=\"https:\/\/www.youtube.com\/embed\/SwB5fBRs_yg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Code Submission:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/FLUX code\r\n\/\/Sunniva Liu\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\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\/\/1,3,5,8 - on; 2,4,6,7 off\r\nint pumpValue1 = 80; \/\/200\r\nint pumpValue2 = 100; \/\/150\r\nint pumpValue3 = 80;\r\nint pumpValue4 = 100;\r\nint pumpValue5 = 100;\r\nint pumpValue6 = 80;\r\nint pumpValue7 = 100;\r\nint pumpValue8 = 80;\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;= 10) {\r\n    counter1 = 0;\r\n  }\r\n  int allData1 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData1 = allData1 + myArray1[i];\r\n  }\r\n  int average1 = allData1 \/ 10;\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;= 10) {\r\n    counter2 = 0;\r\n  }\r\n  int allData2 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData2 = allData2 + myArray2[i];\r\n  }\r\n  int average2 = allData2 \/ 10;\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;= 10) {\r\n    counter3 = 0;\r\n  }\r\n  int allData3 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData3 = allData3 + myArray3[i];\r\n  }\r\n  int average3 = allData3 \/ 10;\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;= 10) {\r\n    counter4 = 0;\r\n  }\r\n  int allData4 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData4 = allData4 + myArray4[i];\r\n  }\r\n  int average4 = allData4 \/ 10;\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;= 10) {\r\n    counter5 = 0;\r\n  }\r\n  int allData5 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData5 = allData5 + myArray5[i];\r\n  }\r\n  int average5 = allData5 \/ 10;\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;= 10) {\r\n    counter6 = 0;\r\n  }\r\n  int allData6 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData6 = allData6 + myArray6[i];\r\n  }\r\n  int average6 = allData6 \/ 10;\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;= 10) {\r\n    counter7 = 0;\r\n  }\r\n  int allData7 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData7 = allData7 + myArray7[i];\r\n  }\r\n  int average7 = allData7 \/ 10;\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;= 10) {\r\n    counter8 = 0;\r\n  }\r\n  int allData8 = 0;\r\n  for (int i = 0; i &lt;= 10; i++) {\r\n    allData8 = allData8 + myArray8[i];\r\n  }\r\n  int average8 = allData8 \/ 10;\r\n\/\/  Serial.println(average8); \r\n  sensorValue[7] = average8;\r\n\r\n\/\/Serial.print(sensorValue)\r\nSerial.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\r\n\r\n\/\/-----set pump pin-----\r\n\r\n\/\/ if distance &gt; x, off pump is increased \r\n\r\n\/\/find smallest two vertical distance\r\n\r\n  int small_value1 = 100; \/\/sensor value\r\n  int small_value2 = 100;\r\n  int small_pin1 = 0; \/\/find sensor location\r\n  int small_pin2 = 0;\r\n  \r\n  for (int i = 1; i &lt; 4; i++){\r\n\/\/    Serial.println(sensorValue[i],i);\r\n    if (sensorValue[i] &lt; small_value1 &amp;&amp; sensorValue[i] != 0){\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;  small_value2 &amp;&amp; i != small_pin1 &amp;&amp; sensorValue[i] != 0){\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 = 80;\r\n  \/\/update the 2+5,4+5,6+5,7+5\r\n  if (small_pin1 &lt;= 7){\r\n     small_pin1 = 7;\r\n  }\r\n  if (small_pin1 &gt; 7){\r\n     small_pin1 = 9;\r\n  }\r\n  if (small_pin2 &lt;= 11){\r\n     small_pin1 = 11;\r\n  }\r\n  if (small_pin2 &gt; 11){\r\n     small_pin1 = 12;\r\n  }\r\n\r\n  \/\/send signals\r\n  analogWrite(small_pin1, pump_updated);\r\n  analogWrite(small_pin2, pump_updated);\r\n  int pumpArray1[4] = {7,9,11,12};\r\n  int pumpArray2[4] = {6,8,10,13};\r\n  for (int n = 0; n&lt;4; n++) {\r\n    if (pumpArray1[n] != small_pin1 | pumpArray1[n] != small_pin2){\r\n    analogWrite(n, 0);\r\n    Serial.println(pumpArray1[n]);\r\n    }\r\n    }\r\n\r\n  for (int n = 0; n&lt;4; n++) {\r\n    analogWrite(pumpArray2[n], 70);\r\n    }\r\n\r\n\r\n\r\n}\r\n\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description \/ Narration: Above viewers see a painting easel that allows them to co-create a visual representation of your interactions with it. The flow of colored ink through&#8230;<\/p>\n","protected":false},"author":138,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[187],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12490"}],"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=12490"}],"version-history":[{"count":7,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12490\/revisions"}],"predecessor-version":[{"id":12524,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/posts\/12490\/revisions\/12524"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/media?parent=12490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/categories?post=12490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2022\/wp-json\/wp\/v2\/tags?post=12490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}