{"id":11704,"date":"2021-11-12T16:57:53","date_gmt":"2021-11-12T21:57:53","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/?p=11704"},"modified":"2021-11-12T16:57:53","modified_gmt":"2021-11-12T21:57:53","slug":"apply-pressure-flow-documentation-olivia","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/apply-pressure-flow-documentation-olivia\/","title":{"rendered":"Apply Pressure Flow Documentation &#8211; Olivia"},"content":{"rendered":"<h2><strong>Apply Pressure<\/strong><\/h2>\n<p><strong>Final Design of the Touch Pad<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11719\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj.png\" alt=\"\" width=\"4032\" height=\"3024\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj.png 4032w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-2048x1536.png 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/final-proj-508x381.png 508w\" sizes=\"(max-width: 4032px) 100vw, 4032px\" \/><\/p>\n<p><strong>Video Demonstration<\/strong><\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-11704-1\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG_6414.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG_6414.mp4\">https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG_6414.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Examples of the Visuals<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11710\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333.jpg\" alt=\"\" width=\"1497\" height=\"1494\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333.jpg 1497w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-300x300.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-1024x1022.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-150x150.jpg 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-768x766.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-88x88.jpg 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-973x971.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/333-508x507.jpg 508w\" sizes=\"(max-width: 1497px) 100vw, 1497px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-11711\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555.jpg\" alt=\"\" width=\"1483\" height=\"1490\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555.jpg 1483w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-300x300.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-1019x1024.jpg 1019w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-150x150.jpg 150w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-768x772.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-88x88.jpg 88w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-973x978.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/555-508x510.jpg 508w\" sizes=\"(max-width: 1483px) 100vw, 1483px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11713\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1711\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-300x201.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-1024x684.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-768x513.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-1536x1027.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-2048x1369.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-973x650.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0040-508x340.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><img loading=\"lazy\" class=\"alignnone size-full wp-image-11718\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1711\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-300x201.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-1024x684.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-768x513.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-1536x1027.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-2048x1369.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-973x650.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0050-508x340.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11714\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1711\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-300x201.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-1024x684.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-768x513.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-1536x1027.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-2048x1369.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-973x650.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0044-1-508x340.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11715\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-scaled.jpg\" alt=\"\" width=\"1711\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-scaled.jpg 1711w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-201x300.jpg 201w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-684x1024.jpg 684w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-768x1149.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-1027x1536.jpg 1027w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-1369x2048.jpg 1369w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-973x1456.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/DSC_0045-2-508x760.jpg 508w\" sizes=\"(max-width: 1711px) 100vw, 1711px\" \/><\/p>\n<h4><strong>Narrative description<\/strong><\/h4>\n<p>Apply pressure is an installation that produces visuals and sounds.\u00a0The physical part of the project is a wooden box, covered in shiny green fabric, with nine force sensors on it that act as buttons. When each button is pressed, colored circles are projected onto a screen and a sound is produced. As the buttons are pressed harder, the nine circles which are projected in a grid on the screen get larger and the sound plays louder.<\/p>\n<h4><strong>Progress Images<\/strong><\/h4>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11706\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6209-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p>This photo shows my first prototype where I struggled to find a rigid material to cover the sensors with. The pressure was not transferring to the sensors even through the thinnest sheet material so I decided to just cover the exposed part of the sensors with fabric in the final design. The fabric I chose did not interfere with the touch sensitivity of the resistors.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11707\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6242-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p>This photo was taken the day I finally got the serial connection to work between processing and the arduino. I was starting to get the visuals I wanted and experimenting with different fabrics to put over top of the touch pad.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11708\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6302-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p>This photo shows me building the final box that would house the touchpad on the top and the breadboard and arduino underneath.\u00a0 I made the final design about twice the size of the prototype so that it was large enough for multiple people to interact with it at once. The hole at the center of the box was where all of the wires from the resistors in the touchpad would come together.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-11709\" src=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-content\/uploads\/2021\/11\/IMG-6323-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>This photo shows the bottom side of the box where the majority of the electronics would be housed on the wooden piece that bridges the length of the box. This was so that the box\u00a0 was mobile while the electronics were in place but I could still easily access them.<\/p>\n<h4><strong>Process Reflection<\/strong><\/h4>\n<p>This project was my first time using Processing which I used to create the audio-visual aspects of the project. Figuring out how to write code to produce the kind of parametric visuals I wanted was not intuitive for me since I am used to designing in a a more visual programming language like Grasshopper. However, after many experimentations and learning through looking at examples I was able to get the visuals to a point where I was happy. I needed some help working through a few bugs with the serial connection to the arduino but once that was set up, adding in the sound component was pretty simple.\u00a0 I feel more comfortable using processing now and definitely want to use it to design visuals for my personal website.<\/p>\n<p>Another challenge I had was deciding how to stabilize the sensors in a way that didn&#8217;t limit their sensitivity as seen in the process images above. Designing the box wound up being a bit difficult but I figured out I could use two layers of acrylic with misaligned grids of holes to essentially sandwich the sensors and keep them in place. One of the most fun parts of this project was sifting through online music samples and choosing the audio components. I put a lot of thought into how the audios sounded together if multiple people were going to be playing with the buttons at the same time.<\/p>\n<p>If I wanted to push the project in a different direction I could have created a different kind of tactile experience instead of the large touchpad embedded into the box. We had previously talked about possibly building nine separate remotes so that the visuals could be collectively produced by people sitting away from one another. This would have created a more experimental nature in the way the project is experienced since it wouldn&#8217;t be as obvious which sensor controlled which part of the visuals and audio. In this case the users would have to figure out who controlled what which could have been fun even though I did enjoy the close collaboration that this project required. Overall I am happy with the way this project came out and it seemed like people were excited about interacting with it during the review.<\/p>\n<h4><strong>Code submission<\/strong><\/h4>\n<p>Arduino Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/\/Apply Pressure\r\n\/\/By Olivia Werner\r\n\/\/This code reads analog input data from nine force sensitive\r\n\/\/resistors and maps the values to be in a range of 0 - 255\r\n\r\nconst int FCR0 = A0; \/\/defining analog sensors\r\nconst int FCR1 = A1;\r\nconst int FCR2 = A2;\r\nconst int FCR3 = A3;\r\nconst int FCR4 = A4;\r\nconst int FCR5 = A5;\r\nconst int FCR6 = A6;\r\nconst int FCR7 = A7;\r\nconst int FCR8 = A8;\r\n\r\nvoid setup() {\r\n  \/\/ put your setup code here, to run once:\r\n  pinMode(FCR0, INPUT);\r\n  pinMode(FCR1, INPUT);\r\n  pinMode(FCR2, INPUT);\r\n  pinMode(FCR3, INPUT);\r\n  pinMode(FCR4, INPUT);\r\n  pinMode(FCR5, INPUT);\r\n  pinMode(FCR6, INPUT);\r\n  pinMode(FCR7, INPUT);\r\n  pinMode(FCR8, INPUT);\r\n  Serial.begin(115200);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ put your main code here, to run repeatedly:\r\n  \/\/if we get a valid byte, read analog ins:\r\n  \/\/if (Serial.available() &gt; 0) {\r\n  \/\/ get incoming byte:\r\n  \/\/inByte = Serial.read();\r\n\r\n  \/\/read the value of the resistance and store it\r\n  int forceVal0 = analogRead(FCR0);\r\n  \/\/map value to 255\r\n  forceVal0 = map(forceVal0, 0, 1023, 0, 255);\r\n  Serial.print(forceVal0);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal1 = analogRead(FCR1);\r\n  \/\/map value to 255\r\n  forceVal1 = map(forceVal1, 0, 1023, 0, 255);\r\n  Serial.print(forceVal1);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal2 = analogRead(FCR2);\r\n  \/\/map value to 255\r\n  forceVal2 = map(forceVal2, 0, 1023, 0, 255);\r\n  Serial.print(forceVal2);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal3 = analogRead(FCR3);\r\n  \/\/map value to 255\r\n  forceVal3 = map(forceVal3, 0, 1023, 0, 255);\r\n  Serial.print(forceVal3);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal4 = analogRead(FCR4);\r\n  \/\/map value to 255\r\n  forceVal4 = map(forceVal4, 0, 1023, 0, 255);\r\n  Serial.print(forceVal4);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal5 = analogRead(FCR5);\r\n  \/\/map value to 255\r\n  forceVal5 = map(forceVal5, 0, 1023, 0, 255);\r\n  Serial.print(forceVal5);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal6 = analogRead(FCR6);\r\n  \/\/map value to 255\r\n  forceVal6 = map(forceVal6, 0, 1023, 0, 255);\r\n  Serial.print(forceVal6);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal7 = analogRead(FCR7);\r\n  \/\/map value to 255\r\n  forceVal7 = map(forceVal7, 0, 1023, 0, 255);\r\n  Serial.print(forceVal7);\r\n  Serial.print(\",\");\r\n  delay(10);\r\n\r\n  int forceVal8 = analogRead(FCR8);\r\n  \/\/map value to 255\r\n  forceVal8 = map(forceVal8, 0, 1023, 0, 255);\r\n  Serial.print(forceVal8);\r\n  Serial.print(\",\");\r\n\r\n  Serial.println(\"0\"); \/\/FAKE VALUE TO DEBUG\r\n\r\n  delay(10);\r\n}<\/pre>\n<p>Processing Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/\/Apply Pressure\r\n\/\/By Olivia Werner\r\n\/\/This code reads serial data from nine force sensitive resistors connected to an arduino mega\r\n\/\/Nine circles are drawn with their size being constantly updated depending on the amount of pressure on the \r\n\/\/force sensitive resistors. The hue of the circles updates randomly creating a gradient. The code also\r\n\/\/plays nine sound files depending on which sensor is being pressed with the volumes controlled by the analog values.\r\n\r\n\r\nimport processing.serial.*;\r\nimport cc.arduino.*;\r\nimport org.firmata.*;\r\nimport processing.sound.*;\r\n\r\nSoundFile[] file;\r\n\/\/ Define the number of samples\r\nint numSounds = 10;\r\n\r\nArduino arduino;\r\n\r\nint timer;\r\n\r\nSerial myPort; \/\/create an object\r\nString val; \/\/data recieved from the serial port\r\n\r\nint[] serialInArray = new int[10]; \/\/ Where we'll put what we receive\r\nint serialCount = 0;     \/\/ A count of how many bytes we receive\r\nString inString;\r\n\r\nArrayList&lt;Circle&gt; circles; \/\/make an array of circles\r\n\r\nvoid setup() {\r\n\r\n  size(1500, 1500);\r\n  colorMode(HSB, 100);\r\n  smooth();\r\n  noFill();\r\n  ellipseMode(CENTER);\r\n\r\n  \/\/ Create an array of empty soundfiles\r\n  file = new SoundFile[numSounds];\r\n\r\n  \/\/ Load 9 soundfiles from a folder in a for loop. By naming the files 0., 1., 2., n.aif it is easy to iterate\r\n  \/\/ through the folder and load all files in one line of code.\r\n  for (int i = 0; i &lt; numSounds; i++) {\r\n    file[i] = new SoundFile(this, (i+1) + \".aif\");\r\n  }\r\n\r\n  \/\/create an array of circles\r\n  circles = new ArrayList&lt;Circle&gt;();\r\n\r\n  \/\/ set the background color with the color values:\r\n  background(serialInArray[7], serialInArray[6], serialInArray[3]);\r\n\r\n  \/\/ Open whatever port is the one you're using.\r\n  String portName = \"COM5\";\r\n  myPort = new Serial(this, \"COM5\", 115200);\r\n}\r\n\r\nvoid draw() {\r\n\r\n  for (Circle  c : circles) {\r\n    c.draw();\r\n    c.update();\r\n  }\r\n  \/\/stop storing circle data after there are 150 circles\r\n  while (circles.size()&gt;150) {\r\n  circles.remove(0);\r\n  }\r\n\r\n  if (millis() - timer &gt; 200)\r\n  {\r\n    \/\/draw nine circles\r\n    circles.add(new Circle(375, 375, serialInArray[0]*3, serialInArray[0]*3));\r\n    circles.add(new Circle(750, 375, serialInArray[1]*4, serialInArray[1]*4));\r\n    circles.add(new Circle(1125, 375, serialInArray[2]*8, serialInArray[2]*8));\r\n\r\n    circles.add(new Circle(375, 750, serialInArray[3]*5, serialInArray[3]*5));\r\n    circles.add(new Circle(750, 750, serialInArray[4]*8, serialInArray[4]*8));\r\n    circles.add(new Circle(1125, 750, serialInArray[5]*6, serialInArray[5]*6));\r\n\r\n    circles.add(new Circle(375, 1125, serialInArray[6]*6, serialInArray[6]*6));\r\n    circles.add(new Circle(750, 1125, serialInArray[7]*3, serialInArray[7]*3));\r\n    circles.add(new Circle(1125, 1125, serialInArray[8]*4, serialInArray[8]*4));\r\n\r\n    timer = millis();\r\n  }\r\n\r\n  \/\/play sounds\r\n  for (int i = 0; i&lt; numSounds-1; i++) {\r\n    if (!file[i].isPlaying() &amp;&amp; serialInArray[i] &gt;0) {\r\n      float volumeLevel = map(serialInArray[i], 0, 255, 0, 1.0); \/\/volume\r\n      file[i].play(1, volumeLevel);\r\n    }\r\n  }\r\n}\r\n\r\nclass Circle {\r\n  int hue = 0;\r\n  float x, y, w, h, sw;\r\n\r\n  Circle(float x, float y, float w, float h) {\r\n    this.x = x;\r\n    this.y = y;\r\n    this.w = w;\r\n    this.h = h;\r\n    sw = random(2, 2);\r\n  };\r\n  \r\n\/\/defining properties of the circles\r\n  void draw() {\r\n    strokeWeight(sw);\r\n    stroke(hue, 100, 100, 100);\r\n    fill(hue, 100, 100, 25);\r\n    ellipse(x, y, w, h);\r\n  }\r\n  \r\n\/\/update gradient\r\n  void update() {\r\n    hue++;\r\n    if (hue == 100) {\r\n      hue = 0;\r\n    }\r\n  }\r\n}\r\n\r\nvoid serialEvent(Serial p) {\r\n  inString = p.readStringUntil('\\n');\r\n\r\n  if (inString != null) {\r\n    \/\/println(inString);\r\n    \r\n    serialInArray = int(split(inString, ','));\r\n    printArray(serialInArray);\r\n  }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Apply Pressure Final Design of the Touch Pad Video Demonstration &nbsp; Examples of the Visuals Narrative description Apply pressure is an installation that produces visuals and sounds.\u00a0The physical&#8230;<\/p>\n","protected":false},"author":130,"featured_media":11710,"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\/f2021\/wp-json\/wp\/v2\/posts\/11704"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/users\/130"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/comments?post=11704"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/posts\/11704\/revisions"}],"predecessor-version":[{"id":11848,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/posts\/11704\/revisions\/11848"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/media\/11710"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/media?parent=11704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/categories?post=11704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/62-362\/f2021\/wp-json\/wp\/v2\/tags?post=11704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}