{"id":416,"date":"2016-09-05T14:56:56","date_gmt":"2016-09-05T14:56:56","guid":{"rendered":"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/05\/frightened-computing\/"},"modified":"2016-09-05T14:56:56","modified_gmt":"2016-09-05T14:56:56","slug":"frightened-computing","status":"publish","type":"post","link":"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/05\/frightened-computing\/","title":{"rendered":"Frightened Computing"},"content":{"rendered":"<p>Description:<br \/>\nChapter two of Acting With Technology begins by offering that \u201c\u2026recent trends in interaction design include emotion in design, extending usability to include the &#8220;pleasurability&#8221; of interactive products (Norman 2004) . . . affective computing (Picard 1997), affective design (Aboulafia and Bannon 2004), [and] autonomous characters (Tomlinson 2005) (Dourish 25). Using two LEDs instead of one introduces affective possibility into an otherwise inanimate series of wires and boards by alluding to a pair of eyes; and by coding the lights to temporarily turn off when the circuit is yelled at one creates perhaps the most basic relationship possible\u2014but a relationship nonetheless, and one that a user should probably find emotionally moving. Relationships between humans and computers are often filled with hostility\u2014a computer appears to not be behaving, and so we express our frustration at it. But what if computers responded to yelling with exhibits of fear, meekness, and regret?<\/p>\n<p>&nbsp;<\/p>\n<p>Components:<br \/>\n\u2022 1 Arduino Uno<br \/>\n\u2022 1 Breadboard<br \/>\n\u2022 2 LEDs<br \/>\n\u2022 Jumper Wires<br \/>\n\u2022 1 Battery pack (4 AA)<br \/>\n\u2022 1 SparkFun Electret Microphone Breakout<\/p>\n<p>&nbsp;<\/p>\n<p>Code:<br \/>\nconst int sampleWindow = 250; \/\/250 MS sample width<br \/>\nunsigned int loudNoise;<\/p>\n<p>void setup()<br \/>\n{<br \/>\npinMode(12, OUTPUT); \/\/these control the LED eyes<br \/>\npinMode(2, OUTPUT);<br \/>\nSerial.begin(9600);<br \/>\n}<\/p>\n<p>void loop()<br \/>\n{<\/p>\n<p>{<br \/>\ndigitalWrite(12, HIGH); \/\/these make the eyes &#8220;on&#8221; by default<br \/>\ndigitalWrite(2, HIGH);<br \/>\ndelay(0);<br \/>\n}<\/p>\n<p>unsigned long start= millis(); \/\/ start of sample window<br \/>\nunsigned int peakToPeak = 0; \/\/ peak-to-peak level<\/p>\n<p>unsigned int signalMax = 0;<br \/>\nunsigned int signalMin = 1024;<\/p>\n<p>while (millis() &#8211; start &lt; sampleWindow) \/\/ collecting data for 250 MS (can be changed)<br \/>\n{<br \/>\nloudNoise = analogRead(0);<br \/>\nif (loudNoise &lt; 1024) \/\/ { if (loudNoise &gt; signalMax) \/\/ if there&#8217;s a loud noise, save the loud value<br \/>\n{<br \/>\nsignalMax = loudNoise;<br \/>\n}<br \/>\nelse if (loudNoise &lt; signalMin) \/\/ if there&#8217;s not a loud noise, don&#8217;t save the loud value { signalMin = loudNoise; } } } peakToPeak = signalMax &#8211; signalMin; \/\/ max &#8211; min = peak-peak amplitude double volts = (peakToPeak * 3.3) \/ 1024; \/\/ convert to volts Serial.println(volts); \/\/ to know if the mic is working if (volts &gt;=1.0)<br \/>\n{<br \/>\ndigitalWrite(2, LOW);<br \/>\ndigitalWrite(12, LOW); \/\/eyes shut off<br \/>\ndelay(2000); \/\/ for a certain amount of time (though this could be modified for more expressive behavior)<br \/>\nSerial.println(&#8220;YELLING AT ME&#8221;);<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\ndigitalWrite(12, LOW);<br \/>\ndigitalWrite(2, LOW); \/\/not yetlling at me<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: Chapter two of Acting With Technology begins by offering that \u201c\u2026recent trends in interaction design include emotion in design, extending usability to include the &#8220;pleasurability&#8221; of interactive products (Norman 2004) . . . affective computing (Picard 1997), affective design &hellip; <a href=\"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/05\/frightened-computing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3271,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60082],"tags":[66682,105,65802],"class_list":["post-416","post","type-post","status-publish","format-standard","hentry","category-lab1","tag-affective-computing","tag-arduino","tag-lab01"],"_links":{"self":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/users\/3271"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":0,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}