{"id":5248,"date":"2022-09-06T21:03:24","date_gmt":"2022-09-07T01:03:24","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/?p=5248"},"modified":"2022-09-06T21:03:25","modified_gmt":"2022-09-07T01:03:25","slug":"servo-hw-with-pico-hw","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/2022\/09\/06\/servo-hw-with-pico-hw\/","title":{"rendered":"Servo HW with Pico hw"},"content":{"rendered":"\n<p>I just used the second example to build my hobby servo program. <\/p>\n\n\n\n<p>It swings side to side regularly starting off slow but becoming more abrupt and quick. It also becomes more erratic as the time goes on. I wanted it to feel sort of like an animal so there&#8217;s a brief pause in the program as if the animal sensed danger. <\/p>\n\n\n\n<p>It has changes in the flow of the program as if changing its direction where its going slowly moving to a point and speeding up after finding a target.<\/p>\n\n\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# begin the movement sequence, starting with some slow sweeps\nprint(&quot;Starting linear motions.&quot;)\nlinear_move(servo, 0.0, 180.0, speed=45)\nlinear_move(servo, 180.0, 0.0, speed=22.5)\nlinear_move(servo, 45.0, 90, speed= 60)\nlinear_move(servo, 70.0, 145.0, speed= 90)\nlinear_move(servo, 55.0, 160, speed = 125)\n\n# brief pause; stillness is the counterpoint\ntime.sleep(4.0)\n\n# start bouncy oscillation movements\nprint(&quot;Starting ringing motions.&quot;)\nringing_move(servo, 90.0, duration=5)\nringing_move(servo, 45.0, duration=1.5)\nringing_move(servo, 90.0, duration=3)\n\ntime.sleep(0.1)\nprint(&quot;Starting linear motions.&quot;)\nlinear_move(servo, 20, 120.0, speed=60)\nlinear_move(servo, 170.0, 10.0, speed=100)\nlinear_move(servo, 79.0, 90, speed= 60)\nlinear_move(servo, 30.0, 145.0, speed= 90)\n\ntime.sleep(1.5)\nprint(&quot;Starting ringing motions.&quot;)\nringing_move(servo, 90.0, duration=5)\nringing_move(servo, 45.0, duration=1.5)\nringing_move(servo, 90.0, duration=3)\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>I just used the second example to build my hobby servo program. It swings side to side regularly starting off slow but becoming more abrupt and quick. It&#8230;<\/p>\n","protected":false},"author":53,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/5248"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=5248"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/5248\/revisions"}],"predecessor-version":[{"id":5250,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/5248\/revisions\/5250"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=5248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=5248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/16-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=5248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}