{"id":1074,"date":"2010-02-26T01:03:54","date_gmt":"2010-02-26T09:03:54","guid":{"rendered":"https:\/\/mathpirate.net\/log\/?p=1074"},"modified":"2010-02-26T01:03:54","modified_gmt":"2010-02-26T09:03:54","slug":"takes-directions-needs-improvement","status":"publish","type":"post","link":"https:\/\/mathpirate.net\/log\/2010\/02\/26\/takes-directions-needs-improvement\/","title":{"rendered":"&#8220;Takes Directions&#8221;: Needs Improvement"},"content":{"rendered":"<p><a href=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1075\" title=\"RedGreensRefactor1\" src=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor1-300x58.jpg\" alt=\"\" width=\"300\" height=\"58\" srcset=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor1-300x58.jpg 300w, https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor1.jpg 490w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So, I hacked the new movement logic into the old Pong processing code.<\/p>\n<p>After an initial lack of movement due to a flipped bit in the Busy property, the robot started turning when it was told to turn.<\/p>\n<p>When it needed to move the paddle down, it rotated counter clockwise.<\/p>\n<p>When it needed to move the paddle up, it rotated counter clockwise.<\/p>\n<p>I think you can get a sense of the problem.<\/p>\n<p>It was a bit frightening to experience, actually.\u00c2\u00a0 It would turn the paddle a little to the left.\u00c2\u00a0 Then a little more.\u00c2\u00a0 Eventually, it would turn so far that the paddle dropped off the bottom of the screen, causing it to launch into recovery mode.\u00c2\u00a0 Recovery mode is where it does a fast clockwise turn to get the paddle back into the visible playfield.\u00c2\u00a0 Unfortunately, when the command &#8220;Fast Clockwise Turn&#8221; gets translated into &#8220;Fast Counter-Clockwise Turn&#8221;, things can go very bad, very fast.\u00c2\u00a0 After the first command did not recover the paddle, it issued another command.\u00c2\u00a0 Then another.\u00c2\u00a0 Then another.\u00c2\u00a0 It quickly hit the counterclockwise extreme of the paddle&#8217;s rotational range, where it was again told to continue in the same direction.\u00c2\u00a0 Then again.\u00c2\u00a0 Then again.<\/p>\n<p>Immovable Object (Paddle Potentiometer) + Irresistable Force (Insane Mindstorms Motor) == Flying Lego Parts.<\/p>\n<p>Even when it wasn&#8217;t attempting to self destruct, the force it exerted and the noise it made while spinning seems a bit excessive.<\/p>\n<p>I think it might be perfect&#8230;<\/p>\n<p>At any rate, I think it tried to calibrate the movement, based on the segment calibration technique I described earlier, but I can&#8217;t tell if it worked because of its slight homicidal streak.\u00c2\u00a0 Gotta get working on that.<\/p>\n<p><a href=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1076\" title=\"RedGreensRefactor2\" src=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor2-300x55.jpg\" alt=\"\" width=\"300\" height=\"55\" srcset=\"https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor2-300x55.jpg 300w, https:\/\/mathpirate.net\/log\/wp-content\/uploads\/2010\/02\/RedGreensRefactor2.jpg 477w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I hacked the new movement logic into the old Pong processing code. After an initial lack of movement due to a flipped bit in the Busy property, the robot started turning when it was told to turn. When it needed to move the paddle down, it rotated counter clockwise. When it needed to move [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[125,7],"tags":[126,42,15,31,20,18,22,28],"_links":{"self":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1074"}],"collection":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/comments?post=1074"}],"version-history":[{"count":2,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1074\/revisions"}],"predecessor-version":[{"id":1078,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1074\/revisions\/1078"}],"wp:attachment":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/media?parent=1074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/categories?post=1074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/tags?post=1074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}