{"id":15,"date":"2025-12-19T16:33:00","date_gmt":"2025-12-19T16:33:00","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/m_vicander\/?p=15"},"modified":"2025-12-19T16:33:00","modified_gmt":"2025-12-19T16:33:00","slug":"how-to-make-your-robot-finch-dance-to-music","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/m_vicander\/2025\/12\/19\/how-to-make-your-robot-finch-dance-to-music\/","title":{"rendered":"how to make your robot finch dance to music."},"content":{"rendered":"\n<p>from BirdBrain import Finch<br>import random<\/p>\n\n\n\n<p>bird = Finch()<\/p>\n\n\n\n<p>print(&#8220;Sound: &#8220;, bird.getSound())<\/p>\n\n\n\n<p>bird.getSound()<\/p>\n\n\n\n<p>def random_lights(t, count):<br>for i in range(count):<br>bird.setTail(1, random.randint(1,100),random.randint(1,100),random.randint(1,100))<br>bird.setTail(2, random.randint(1,100),random.randint(1,100),random.randint(1,100))<br>bird.setTail(3, random.randint(1,100),random.randint(1,100),random.randint(1,100))<br>bird.setTail(4, random.randint(1,100),random.randint(1,100),random.randint(1,100))<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    bird.setBeak(random.randint(1,100),random.randint(1,100),random.randint(1,100))\n    time.sleep(t)<\/code><\/pre>\n\n\n\n<p>while True:<br>sound = bird.getSound()<br>print(sound)<br>if sound &gt;= 50:<br>break<\/p>\n\n\n\n<p>random_lights(.2, 10)<br>for i in range(10):<br>bird.setTurn(&#8220;R&#8221;,1000,100)<br>bird.setTurn(&#8220;L&#8221;,1000,100)<br>bird.print(&#8220;its chrismas time &#8220;)<br>random_lights(.1, 30)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>from BirdBrain import Finchimport random bird = Finch() print(&#8220;Sound: &#8220;, bird.getSound()) bird.getSound() def random_lights(t, count):for i in range(count):bird.setTail(1, random.randint(1,100),random.randint(1,100),random.randint(1,100))bird.setTail(2, random.randint(1,100),random.randint(1,100),random.randint(1,100))bird.setTail(3, random.randint(1,100),random.randint(1,100),random.randint(1,100))bird.setTail(4, random.randint(1,100),random.randint(1,100),random.randint(1,100)) while True:sound = bird.getSound()print(sound)if sound &gt;= 50:break random_lights(.2, 10)for i in range(10):bird.setTurn(&#8220;R&#8221;,1000,100)bird.setTurn(&#8220;L&#8221;,1000,100)bird.print(&#8220;its chrismas time &#8220;)random_lights(.1, 30)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":16,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/posts\/15\/revisions\/16"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/m_vicander\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}