{"id":140,"date":"2008-10-16T03:07:42","date_gmt":"2008-10-16T07:07:42","guid":{"rendered":"http:\/\/itp.indiamos.com\/blog\/?p=140"},"modified":"2008-10-16T03:10:07","modified_gmt":"2008-10-16T07:10:07","slug":"physcomp-week-6-bride-of-serial-out","status":"publish","type":"post","link":"https:\/\/itp.indiamos.com\/blog\/2008\/10\/16\/physcomp-week-6-bride-of-serial-out\/","title":{"rendered":"PhysComp, week 6: Bride of Serial Out"},"content":{"rendered":"<p><a href=\"http:\/\/itp.nyu.edu\/physcomp\/Labs\/SerialDuplex\">This week&#8217;s lab<\/a> was mostly uneventful, although it took me something like six hours to do&#8212;I started after our CommLab make-up class ended, around 4 pm, and stayed until nine or ten.<\/p>\n<p>First I thought I&#8217;d use one of these nifty sensors I got from SparkFun, <\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2943803298\/\" title=\"PComp lab, week 5: Serial Out by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/farm4.static.flickr.com\/3031\/2943803298_1f73c40d47_m.jpg?resize=240%2C180\" width=\"240\" height=\"180\" alt=\"PComp lab, week 5: Serial Out\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>but then I realized I have no idea how you&#8217;re supposed to hook them up. Stick the pins straight into the breadboard? Solder wires on? How long should the wires be? So instead I used the stupid knob again, plus one of the IRs I bought for our midterm project.<\/p>\n<p>The thrill of the knob has totally worn off. Then I saw Jorge soldering wires to an ultrasonic range finder just like the one I have, and I thought maybe it was a good time to try out my own. Ha! Thus began one of my more frustrating soldering bouts so far.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2943803750\/\" title=\"Helping hands by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3221\/2943803750_eb43911272_m.jpg?resize=240%2C180\" width=\"240\" height=\"180\" alt=\"Helping hands\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>It must have taken me forty-five minutes to solder three freaking wires onto this cookie . . . and then it took me another hour to realize that the reason it wasn&#8217;t working was that I&#8217;d soldered the yellow wire to the wrong hole. And then I couldn&#8217;t get it <em>un<\/em>soldered to save my life, so I just attached a fourth wire.<\/p>\n<p>Finally I got them all hooked up:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2942944227\/\" title=\"1 digital + 2 analog by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/farm4.static.flickr.com\/3206\/2942944227_264e83109e_m.jpg?resize=180%2C240\" width=\"180\" height=\"240\" alt=\"1 digital + 2 analog\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>And then, there was serial output:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2946608608\/in\/set-72157607212375323\/\">&#8220;Now you get a range of garbage characters.&#8221;<\/a><\/li>\n<li><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2946608692\/in\/set-72157607212375323\/\">&#8220;List all the available serial ports.&#8221;<\/a><\/li>\n<li><code> <a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2946609060\/in\/set-72157607212375323\/\">\/\/ print out the values you got:<\/a><br \/>\n    for (int sensorNum = 0; sensorNum < sensors.length; sensorNum++) {\n      print(\"Sensor \" + sensorNum + \": \" + sensors[sensorNum] + \"\\t\"); \n    }\n    \/\/ add a linefeed after all the sensor values are printed:\n    println();<\/code><\/li>\n<\/ul>\n<p>Et cetera.<\/p>\n<p>After all that hair-pulling, the ultrasonic sensor was giving me really erratic readings (then again, so was the push-button switch: its value didn't change when I <em>pushed<\/em> the button, but it did when I <em>touched<\/em> the button). So I switched to two IR sensors, since I had so many lying around.<\/p>\n<p>Then I got to the part about the handshake. Handshaking? Was not happening for me. I think it may have had something to do with this:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2945745779\/\" title=\"PhysComp homework, week 6: serial out 2: 15 by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/farm4.static.flickr.com\/3203\/2945745779_02eb104340_m.jpg?resize=226%2C240\" width=\"226\" height=\"240\" alt=\"PhysComp homework, week 6: serial out 2: 15\" data-recalc-dims=\"1\" \/><\/a> <a href=\"http:\/\/www.flickr.com\/photos\/indiamos\/2945745813\/\" title=\"PhysComp homework, week 6: serial out 2: 16 by indiamos, on Flickr\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/farm4.static.flickr.com\/3049\/2945745813_3abc083f17_m.jpg?resize=226%2C240\" width=\"226\" height=\"240\" alt=\"PhysComp homework, week 6: serial out 2: 16\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>The Processing application was looking for the word \"hello,\" but the Arduino didn't seem to be able to say the word without stuttering horribly. I tried for more than an hour, I think, to get them to talk to each other, but finally I had to just give up.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s lab was mostly uneventful, although it took me something like six hours to do&#8212;I started after our CommLab make-up class ended, around 4 pm, and stayed until nine or ten. First I thought I&#8217;d use one of these nifty sensors I got from SparkFun, but then I realized I have no idea how &hellip; <a href=\"https:\/\/itp.indiamos.com\/blog\/2008\/10\/16\/physcomp-week-6-bride-of-serial-out\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">PhysComp, week 6: Bride of Serial Out<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/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,9,10],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3qY10-2g","_links":{"self":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/140"}],"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=140"}],"version-history":[{"count":5,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itp.indiamos.com\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}