{"id":311,"date":"2007-07-22T02:48:00","date_gmt":"2007-07-22T06:48:00","guid":{"rendered":"http:\/\/johncohn.org\/base\/2007\/07\/22\/staurday-night-eight-months\/"},"modified":"2007-07-22T02:48:00","modified_gmt":"2007-07-22T06:48:00","slug":"staurday-night-eight-months","status":"publish","type":"post","link":"http:\/\/johncohn.org\/base\/2007\/07\/22\/staurday-night-eight-months\/","title":{"rendered":"Staurday Night &#8211; eight months"},"content":{"rendered":"<div id=\"pBlogBody_290453209\" class=\"blogContent\">\n<p class=\"MsoNormal\">Where to start ? I went around today with some sort of weight on me.. not really knowing what was troubling me. When I sat down to write I realized that today was the eighth month anniversary of Sam&#8217;s passing.. Sam was on my mind so vividly and so close to me today,,, all day.,, it&#8217;s amazing that my heart knows this stuff even when my brain does not.. <span style=\"\">&nbsp;&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><br \/><span style=\"\">&nbsp;&nbsp; <\/span>The only thing I had planned today was to take Hannah, Avery and Brittany F to Homer&#8217;s to learn about CNC (computer numerical control) routing. Homer is one of the best people I know for transforming ideas into stuff (My brother Billy is great at that too) .<\/p>\n<p class=\"MsoNormal\">Hannah showed up at around 9\u2026Before we left, I tried<span style=\"\">&nbsp; <\/span>to sweat talk<span style=\"\">&nbsp; <\/span>our pool heater into restarting after it ran out of gas. It responded to my kindness by blowing it&#8217;s front door off and singeing all the hair off my forearm.. yikes !<span style=\"\">&nbsp; <br \/><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><center><br \/><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107002.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107001.jpg\" \/><\/p>\n<p><\/center><\/p>\n<p class=\"MsoNormal\"><span style=\"\"><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"\"><\/span>It did finally start so Hannah and I headed off to pick up <st1:place><st1:city>Avery<\/st1:city>, <st1:state>Brittany<\/st1:state><\/st1:place> and Avery&#8217;s mom, Jen. We showed up at Homer&#8217;s around 1-:30. <\/p>\n<p style=\"text-align: center;\" class=\"MsoNormal\"><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107012.jpg\" \/><\/p>\n<p class=\"MsoNormal\">The girls talked with him for awhile and came up with the idea of making a metal stencil for making (appropriate) graffiti. The design was a hand.. with the girls three initials in it &#8216;B&#8217;-&#8216;A&#8217;-&#8216;H&#8217; and some curly-queues and what not. They drew the picture and gave it to Homer. He scanned the image and ran it through his miraculous programs that transformed it into cutting instructions for his giant router. <\/p>\n<p class=\"MsoNormal\">\n<p><center>The girls looking at the setup<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107047.jpg\" \/><\/p>\n<p>The router was scary and smelled funny<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107049.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107030.jpg\" \/><\/p>\n<p>Homer shows them the ropes<\/p>\n<p>Brittany looking wistful<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107028.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107027.jpg\" \/><\/p>\n<p>The scanned artwork<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107024.jpg\" \/><\/p>\n<p>Avery featured on Homervision<\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107019.jpg\" \/><\/div>\n<div style=\"text-align: center;\"><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107032.jpg\" \/><\/p>\n<p>Staring Avery&#8217;s eye !<\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107039.jpg\" \/><\/p>\n<p>A short intelude for me to show them the fire organ idea<\/div>\n<\/div>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107022.jpg\" \/><\/p>\n<p><\/center><\/p>\n<p class=\"MsoNormal\">He then used the router to cut the girl&#8217;s design our of perforated aluminum.<span style=\"\">&nbsp;&nbsp; <\/span>It&#8217;s amazing to see that giant machine doing such delicate work<\/p>\n<p style=\"text-align: center;\" class=\"MsoNormal\"><object enablejsurl=\"false\" enablehref=\"false\" saveembedtags=\"true\" allowscriptaccess=\"never\" allownetworking=\"internal\" type=\"application\/x-shockwave-flash\" allowscriptaccess=\"never\" allownetworking=\"internal\" height=\"361\" width=\"448\" data=\"http:\/\/i147.photobucket.com\/player.swf?file=http:\/\/vid147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/dd7a5f03.flv\"><param name=\"allowScriptAccess\" value=\"never\"><\/param><param name=\"allowNetworking\" value=\"internal\"><\/param><param name=\"movie\" value=\"http:\/\/i147.photobucket.com\/player.swf?file=http:\/\/vid147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/dd7a5f03.flv\"><\/param><\/object><\/p>\n<p class=\"MsoNormal\">. I think it&#8217;s so cool when you have the tools and material to take something from idea to object in less than an hour. We used the stencil and the scrap to paint some pretty cool street art.. and make some cool shadows. It was very cool.<span style=\"\">&nbsp;&nbsp; <\/span>The girls loved it (I think !) .<span style=\"\">&nbsp; <br \/><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"\"><center><br \/><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107122.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107121.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107118.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107117.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107110.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107103.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107102.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107091.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107082.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107076.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107075.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107072.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107071.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107062.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107057.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107056.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107024.jpg\" \/><\/p>\n<p>Some frolicking was allowed<\/p>\n<p><\/center><\/span><\/p>\n<div style=\"text-align: center;\"><span style=\"\"><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107097.jpg\" \/><\/span><\/div>\n<p class=\"MsoNormal\"><span style=\"\"> <\/span>It was a nice way to spend the day.. but I was somehow grumpy.. I think because of thinking about Sam.<\/p>\n<p><\/p>\n<p class=\"MsoNormal\"><\/p>\n<p class=\"MsoNormal\"> <\/p>\n<p class=\"MsoNormal\"><span style=\"\">&nbsp;&nbsp; <\/span>That ended up taking a good portion of the day.. I came back here to find Diane and Kevin<span style=\"\">&nbsp; <\/span>in the new <st1:place>Adirondack<\/st1:place> chairs that Scott has been building for us.. It looks like Diane<span style=\"\">&nbsp; <\/span>had a peaceful day.. She&#8217;d spent some time up watching the Voices movie filming.. which she enjoyed.<span style=\"\">&nbsp;&nbsp; <\/span>Diane ended up taking Kevin back to Avery&#8217;s while I started to putter in my lab\u2026 I&#8217;d had an idea bout creating a set of lights that bounced in synch with the person jumping on the trampoline. I&#8217;d seen someone synch of a flamethrower with his tramp. So I figured lights would be pretty easy.<span style=\"\">&nbsp;&nbsp; <\/span>I though about a few ways to do it.. and finally settled on using ultrasonic. I took a Basic Stamp 2 microcontroller and hooked up an ultrasonic transducer.. Then I adapted some code that sent pings to the transducer and then measured the time for the response.. That roughly correlates to the distance. I wrote some rudimentary code that would allow me to stick the sensor under the trampoline<span style=\"\">&nbsp;&nbsp; <\/span>and measure the distance the trampoline surface was deflected. I then wired up some solid state relays which would let me control lights with that information. I got something crude working just before dark. At that time, Diane suggested we go out to eat.. (<st1:country-region><st1:place>India<\/st1:place><\/st1:country-region> house yum !).. and go by Barnes and Noble.. to pick up tour reserved copy of the Harry Potter book. By the time we got home<span style=\"\">&nbsp; <\/span>there were a <i style=\"\">ton<\/i> of Voices people here. I hooked up my circuits to the lights and stuck it under the trampoline.. <i style=\"\">It Worked !,<\/i> Travis made some good suggestion on how to improve the visual effects.. by measuring the lights on the amount the surface changed.. not just on it&#8217;s absolute deflection.. <i style=\"\">It Worked Even Better !<\/i> . Max was kind enough to test it out for me.. Pretty cool. I think Gabe is going to love it\u2026<span style=\"\">&nbsp; <\/span>Sam.. I hope you were watching.. you would love it too !<\/p>\n<p style=\"text-align: center;\" class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p><center><br \/><object enablejsurl=\"false\" enablehref=\"false\" saveembedtags=\"true\" allowscriptaccess=\"never\" allownetworking=\"internal\" type=\"application\/x-shockwave-flash\" allowscriptaccess=\"never\" allownetworking=\"internal\" height=\"361\" width=\"448\" data=\"http:\/\/i147.photobucket.com\/player.swf?file=http:\/\/vid147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/71b14951.flv\"><param name=\"allowScriptAccess\" value=\"never\"><\/param><param name=\"allowNetworking\" value=\"internal\"><\/param><param name=\"movie\" value=\"http:\/\/i147.photobucket.com\/player.swf?file=http:\/\/vid147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/71b14951.flv\"><\/param><\/object><\/p>\n<div style=\"text-align: center;\">The Stamp II microntroller I used for the tramp lights<\/div>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107142.jpg\" \/><\/p>\n<div style=\"text-align: left; margin-left: 80px;\">\n<div style=\"text-align: center;\">Some crufty BASIC code to do the range measuring and light control on the microcontroller<\/div>\n<p>&#8216; <span style=\"font-style: italic;\">=========================================================================<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; File&#8230;&#8230;. Ping_Demo.BS2<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Purpose&#8230;. Demo Code for Parallax PING))) Sonar Sensor<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Author&#8230;.. Parallax, Inc.<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; E-mail&#8230;.. support@parallax.com<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Started&#8230;.<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Updated&#8230;. 08 JUN 2005<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; {$STAMP BS2}<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; {$PBASIC 2.5}<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; =========================================================================<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Program Description &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; This program demonstrates the use of the Parallax PING))) sensor and then<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; converting the raw measurement to English (inches) and Metric (cm) units.<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Sonar Math:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; At sea level sound travels through air at 1130 feet per second. This<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; equates to 1 inch in 73.746 uS, or 1 cm in 29.034 uS).<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; Since the PING))) sensor measures the time required for the sound wave to<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; travel from the sensor and back. The result &#8212; after conversion to<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; microseconds for the BASIC Stamp module in use &#8212; is divided by two to<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; remove the return portion of the echo pulse. The final raw result is<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; the duration from the front of the sensor to the target in microseconds.<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; I\/O Definitions &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Ping PIN 15<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Light PIN 0<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Light_2 PIN 1<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Constants &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">SELECT $STAMP &#8216;define constants based on hardware\/environment variables<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CASE BS2, BS2E<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Trigger CON 5 &#8216; trigger pulse = 10 uS<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Scale CON $200 &#8216; raw x 2.00 = uS<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CASE BS2SX, BS2P, BS2PX<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Trigger CON 13<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Scale CON $0CD &#8216; raw x 0.80 = uS<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CASE BS2PE<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Trigger CON 5<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Scale CON $1E1 &#8216; raw x 1.88 = uS<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">ENDSELECT<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">RawToIn CON 889 &#8216; 1 \/ 73.746 (with **)<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">RawToCm CON 2257 &#8216; 1 \/ 29.034 (with **)<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IsHigh CON 1 &#8216; for PULSOUT<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IsLow CON 0<\/span><br style=\"font-style: italic;\" \/><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Variables &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">junk VAR Word &#8216; raw measurement<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">rawDist VAR Word &#8216; raw measurement<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">inches VAR Word<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">cm VAR Word<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">old VAR Word<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">diff VAR Word<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Initialization &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Reset:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEBUG CLS,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8220;Parallax PING))) Sonar&#8221;, CR, &#8216; setup report screen<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8220;======================&#8221;, CR,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CR,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8220;Time (uS)&#8230;.. &#8220;, CR,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8220;Inches&#8230;&#8230;.. &#8220;, CR,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8220;Centimeters&#8230; &#8220;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Program Code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Main:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">old = 99<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DO<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">GOSUB Get_Sonar &#8216; get sensor value<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">inches = rawDist ** RawToIn &#8216; convert to inches<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">cm = rawDist ** RawToCm &#8216; convert to centimeters<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IF inches > 120 THEN GOTO done<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEBUG CRSRXY, 15, 3, &#8216; update report screen<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEC rawDist, CLREOL,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CRSRXY, 15, 4,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEC inches, CLREOL,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">CRSRXY, 15, 5,<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEC junk, CLREOL<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;IF inches < 26&nbsp; OR inches >120 THEN GOTO down<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">diff = ABS(inches &#8211; old )<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IF&nbsp;&nbsp; diff > 10 THEN GOTO way_down<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IF&nbsp;&nbsp; diff > 5 THEN GOTO down<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEBUG CRSRXY, 15, 6, DEC old,&#8221; &#8220;, DEC diff, &#8221; up&#8221;, CLREOL<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">LOW&nbsp; Light<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">LOW&nbsp; Light_2<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">GOTO OOR<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">way_down:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEBUG CRSRXY, 15, 6, DEC old,&#8221; &#8220;, DEC diff, &#8221; way down&#8221;, CLREOL<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">HIGH Light_2<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">HIGH Light<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">GOTO OOR<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">down:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">DEBUG CRSRXY, 15, 6, DEC old,&#8221; &#8220;, DEC diff, &#8221; down&#8221;, CLREOL<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">LOW&nbsp; Light_2<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">HIGH Light<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">OOR:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">PAUSE 100<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IF inches > 120 THEN GOTO done<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">old =&nbsp; inches<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">done:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">LOOP<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">END<\/span><br style=\"font-style: italic;\" \/><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; &#8212;&#8211; Subroutines &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; This subroutine triggers the PING))) sonar sensor and measures<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; the echo pulse. The raw value from the sensor is converted to<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; microseconds based on the Stamp module in use. This value is<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; divided by two to remove the return trip &#8212; the result value is<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216; the distance from the sensor to the target in microseconds.<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Get_Sonar:<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">Ping = IsLow &#8216; make trigger 0-1-0<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">PULSOUT Ping, Trigger &#8216; activate sensor<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">PULSIN Ping, IsHigh, junk &#8216; measure echo pulse<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">IF junk <&nbsp; 9200 THEN&nbsp; GOTO ok<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">ok:&lt;\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">rawDist = junk<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">rawDist = rawDist *\/ Scale &#8216; convert to uS<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">rawDist = rawDist \/ 2 &#8216; remove return trip<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">&#8216;IF rawDist > 9200 THEN GOTO Get_Sonar<\/span><br style=\"font-style: italic;\" \/><span style=\"font-style: italic;\">RETURN<\/span><br \/><\/span><\/div>\n<p>The setup.. the transducer is under the tramp<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107127.jpg\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i147.photobucket.com\/albums\/r319\/johncohn\/jul07i\/jul2107137.jpg\" \/><\/p>\n<p><\/center><\/p>\n<p class=\"MsoNormal\">OK.. Gotta sleep now.. I&#8217;m heading off to NY tomorrow at <st1:time minute=\"0\" hour=\"6\">6AM<\/st1:time> to go to a memorial for my friend Bill&#8217;s wife.. I&#8217;ll be back on Monday\u2026<span style=\"\">&nbsp;&nbsp; <\/span><\/p>\n<p class=\"MsoNormal\">Love to all.. you, too Sam. <\/p>\n<p class=\"MsoNormal\"><o:p>&nbsp;<\/o:p><\/p>\n<p class=\"MsoNormal\">-me <o:p><\/o:p><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Where to start ? I went around today with some sort of weight on me.. not really knowing what was troubling me. When I sat down to write I realized that today was the eighth month anniversary of Sam&#8217;s passing.. Sam was on my mind so vividly and so close to me today,,, all day.,, &hellip; <a href=\"http:\/\/johncohn.org\/base\/2007\/07\/22\/staurday-night-eight-months\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Staurday Night &#8211; eight months<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-311","post","type-post","status-publish","format-standard","hentry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":0,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"wp:attachment":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}