{"id":7,"date":"2008-09-11T08:56:18","date_gmt":"2008-09-11T12:56:18","guid":{"rendered":"http:\/\/itp.nyu.edu\/blogs\/ia303\/2008\/09\/11\/digital-inout\/"},"modified":"2008-09-25T05:13:30","modified_gmt":"2008-09-25T09:13:30","slug":"digital-inout","status":"publish","type":"post","link":"https:\/\/itp.indiamos.com\/blog\/2008\/09\/11\/digital-inout\/","title":{"rendered":"PhysComp lab, week 1: Digital in\/out"},"content":{"rendered":"<p>First homework for <a href=\"http:\/\/itp.nyu.edu\/physcomp\/Main\/HomePage\">Physical Computing<\/a>: <a href=\"http:\/\/itp.nyu.edu\/physcomp\/Labs\/DigitalInOut\">Digital In Out<\/a>.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2847496653\/\" title=\"Supplies for PhysComp homework by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3108\/2847496653_e747625288_m.jpg?resize=240%2C180\" width=\"240\" height=\"180\" alt=\"Supplies for PhysComp homework\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><strong>11:15<\/strong>: I forgot how hard you have to pull to strip the insulation off the wire (or is it just me?).<\/p>\n<p><strong>11:30<\/strong>: Wow, I totally remember that smell of hot soldering iron from my childhood. Nevertheless, I am the worst solderer ever.<!--more--><\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2847558027\/\" title=\"Switch by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3122\/2847558027_782cf5d949_m.jpg?resize=240%2C180\" width=\"240\" height=\"180\" alt=\"Switch\" alt=\"Wires badly soldered onto a switch\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><strong>11:45<\/strong>: Yes, worst solderer ever. Not being able to see anything close up anymore doesn&#8217;t help, either; obviously, I should have gone to ITP while I was still in my twenties and only half-blind.<\/p>\n<p><strong>11:50<\/strong>: Oh, yeah&#8212;now I remember how to use wire strippers. Rotate.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2847498079\/\" title=\"Arduino and Breadboard by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3191\/2847498079_4ba91f9e5c.jpg?resize=474%2C235\" width=\"474\" height=\"235\" alt=\"Arduino and Breadboard\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><strong>12:15<\/strong>: Looking up resistor values. Did I miss some introductory class where we were supposed to learn all this shit? Honestly, if I hadn&#8217;t spent weekend afternoons sorting resistors for my dad when I was in grade school, I think I&#8217;d be completely lost right now. Setting up a straightforward circuit on a breadboard should not be taking this long.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2847572607\/\" title=\"Resistors by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/farm4.static.flickr.com\/3231\/2847572607_df7efb9416.jpg?resize=425%2C318\" width=\"425\" height=\"318\" alt=\"Two kinds of resistors\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h3>Resistor Values<\/h3>\n<p>Cheat cheet: <a href=\"http:\/\/www.iguanalabs.com\/resistors.htm\">http:\/\/www.iguanalabs.com\/resistors.htm<\/a><\/p>\n<p>10 x brown black black gold = 10<\/p>\n<p>10 x brown black brown gold = 100<\/p>\n<p>10 x red red brown gold = 220<\/p>\n<p>10 x brown black red gold = 1,000<\/p>\n<p>10 x brown black orange gold = 10,000<\/p>\n<p>5 x orange black orange gold = 30,000<\/p>\n<p>5 x brown black yellow gold = 100,000<\/p>\n<p><strong>12:50<\/strong>: Done sorting resistors, distributing into parts box, drawing and inserting labels.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2847507943\/\" title=\"Parts case with resistor labels by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/farm4.static.flickr.com\/3217\/2847507943_6bf44ee10f.jpg?resize=474%2C356\" width=\"474\" height=\"356\" alt=\"Parts case with resistor labels\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><strong>1:15<\/strong>: Finally, my circuit looks like the photo on the website (well, except for the googly eyes). Woot!<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2848338964\/\" title=\"Artificial intelligence? by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3216\/2848338964_211bd92097.jpg?resize=474%2C316\" width=\"474\" height=\"316\" alt=\"Artificial intelligence?\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Does it <em>do<\/em> anything, though?<\/p>\n<p><strong>1:25<\/strong>: Aaargh! The answer to that question is, <em>No.<\/em><\/p>\n<blockquote><p>Problem uploading to board. See http:\/\/www.arduino.cc\/en\/Guide\/Troubleshooting#upload for suggestions.<\/p>\n<p>Binary sketch size: 1126 bytes (of a 14336 byte maximum)<\/p>\n<p>avrdude: stk500_recv(): programmer is not responding<br \/>\navrdude: stk500_recv(): programmer is not responding<\/p><\/blockquote>\n<p><strong>1:28<\/strong>: Hmm. It uploads fine when nothing is connected to the board.<\/p>\n<p><strong>1:30<\/strong>: Okay, the red LED lights up when I hold down the switch. The green LED doesn&#8217;t do anything, though.<\/p>\n<p><strong>1:35<\/strong>: <a href=\"http:\/\/www.arduino.cc\/en\/Guide\/Troubleshooting#upload\">Troubleshooting<\/a>. Tried swapping the red and green LEDs: now nothing works. Replaced the green LED with a yellow one: nothing. Re-uploaded the program to the board (which worked just fine this time): nothing. Shite.<\/p>\n<p>Unplugged everything except the USB cable, hit reset, re-uploaded program: error message. Reset, tried uploading again: worked. Plugged breadboard back in: nothing happening.<\/p>\n<p>Hit reset, re-uploaded program: error message.<br \/>\nNo reset, re-uploaded program: error message.<br \/>\nReset, re-uploaded program: upload okay, but no lights.<br \/>\nJiggled all the connections. Nothing.<br \/>\nUnplugged &amp; replugged USB cable, reset, re-upload: nothing.<\/p>\n<p>AAAAARRRRGGGHHH!!!! I give up.<\/p>\n<p>Reversed the legs of the yellow LED: lit up. Hmm. Reversed legs of red LED: lit up. Now both are lit. When I hold down the switch, both turn off.<\/p>\n<p>Reset, re-upload: error, both lights on.<br \/>\nReset, re-upload: okay, both lights on.<\/p>\n<p>Changed code to<\/p>\n<blockquote><p>  if (switchState == 1) {<br \/>\n    \/\/ if the switch is closed:<br \/>\n    digitalWrite(yellowLedPin, HIGH);    \/\/ turn on the yellow LED<br \/>\n    digitalWrite(redLedPin, HIGH);       \/\/ turn off the red LED<br \/>\n  }<br \/>\n  else {<br \/>\n    \/\/ if the switch is open:<br \/>\n    digitalWrite(yellowLedPin, LOW);   \/\/ turn off the yellow LED<br \/>\n    digitalWrite(redLedPin, LOW);     \/\/ turn on the red LED<\/p><\/blockquote>\n<p>    Reset, re-upload: okay, lights off. Pressing switch turns both on.<\/p>\n<p>. . .<\/p>\n<p>YAAAAYY!! In switching the LEDs around, at some point I got one leg into the wrong row. Everything now works exactly as intended! Aaaand . . . it&#8217;s 2 a.m. Bummer. So much for Part II of this week&#8217;s homework: making a combination lock using a LEGO phone.<\/p>\n<p>So.<\/p>\n<p>I don&#8217;t feel like I had any idea what I was doing with this assignment, besides trying to copy <a href=\"http:\/\/itp.nyu.edu\/physcomp\/uploads\/arduino_switch_leds.jpg\">the photo<\/a> exactly. I didn&#8217;t refer to <a href=\"http:\/\/itp.nyu.edu\/physcomp\/uploads\/digital_io.png\">the diagram<\/a> much, because I don&#8217;t really remember <em>from high school<\/em> how to read an electrical diagram. All in all, I felt pretty uninformed. It would have helped to be doing this in the lab at school, surrounded by other cursing, frustrated people, but I would have had to bend space and time rather drastically in order to be able to work there. Other inhabitants of the universe might have thereby been inconvenienced.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First homework for Physical Computing: Digital In Out. 11:15: I forgot how hard you have to pull to strip the insulation off the wire (or is it just me?). 11:30: Wow, I totally remember that smell of hot soldering iron from my childhood. Nevertheless, I am the worst solderer ever.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[12,11,4,8,6],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3qY10-7","_links":{"self":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/7"}],"collection":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":1,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":54,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/54"}],"wp:attachment":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}