{"id":249,"date":"2008-12-08T02:32:45","date_gmt":"2008-12-08T06:32:45","guid":{"rendered":"http:\/\/mikelberman.com\/blog\/?p=249"},"modified":"2008-12-08T02:32:45","modified_gmt":"2008-12-08T06:32:45","slug":"photobooth-update-pt3","status":"publish","type":"post","link":"http:\/\/mikelberman.com\/blog\/?p=249","title":{"rendered":"Photobooth Update pt.3"},"content":{"rendered":"<p><a href=\"http:\/\/madparker.com\/\">Matt Parker<\/a> helped me debug my code today.\u00a0 I orginally had a switch talking to arduino, and the arduino would take the picture.\u00a0 Since I had the switch being checked in the loop() function (the main function of arduino, in which it infinitely loops), it was looping a high value to the relay.\u00a0 This means that I was triggering the switch for maybe one quarter of a second, whereas using just the code would trigger for 1\/1000th of a second (not actual time, just to explain).<\/p>\n<p>We both thought that something was wrong in the code and it would never fire to the camera.\u00a0 Matt used the Serial.print() inside of the conditional, so we could at least see if the conditions were being satisfied.\u00a0 They were.\u00a0 We immediately realized that the impulse just was not long enough.\u00a0 Whew.\u00a0 Thanks Matt.\u00a0 Thanks to <a href=\"http:\/\/timothytwillman.com\/\">Tym Twillman<\/a> for help debugging the rotary impulses too &#8211; apparently there is noise in the first few milliseconds when the voltage rises to a HIGH value.\u00a0 By putting in a delay before counting transitions, I am able to avoid intermittent connections and which would produce an error in counting.<\/p>\n<p>Here&#8217;s a video of the camera triggered by rotary dial.<\/p>\n<p><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"400\" height=\"300\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"allowfullscreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><param name=\"src\" value=\"http:\/\/vimeo.com\/moogaloop.swf?clip_id=2460359&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" \/><embed type=\"application\/x-shockwave-flash\" width=\"400\" height=\"300\" src=\"http:\/\/vimeo.com\/moogaloop.swf?clip_id=2460359&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" allowscriptaccess=\"always\" allowfullscreen=\"true\"><\/embed><\/object><\/p>\n<p><a href=\"http:\/\/vimeo.com\/2460359\">Dial &#8217;10&#8217; for Murderously Awesome Photos<\/a> from <a href=\"http:\/\/vimeo.com\/user950343\">mike k<\/a> on <a href=\"http:\/\/vimeo.com\">Vimeo<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matt Parker helped me debug my code today.\u00a0 I orginally had a switch talking to arduino, and the arduino would take the picture.\u00a0 Since I had the switch being checked in the loop() function (the main function of arduino, in which it infinitely loops), it was looping a high value to the relay.\u00a0 This means [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","hentry","category-physical-computing"],"_links":{"self":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":4,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":254,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions\/254"}],"wp:attachment":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}