{"id":976,"date":"2023-01-26T09:56:59","date_gmt":"2023-01-26T09:56:59","guid":{"rendered":"http:\/\/learnlearn.uk\/microbit\/?page_id=976"},"modified":"2023-02-08T10:34:01","modified_gmt":"2023-02-08T10:34:01","slug":"continuous-servos","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/","title":{"rendered":"Controlling a continuous servo with the Microbit"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Introduction<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Introduction<\/h3>\n<div id=\"attachment_442\" style=\"width: 260px\" class=\"wp-caption alignright\"><img aria-describedby=\"caption-attachment-442\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-442 size-full\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2016\/07\/continuous-servo.gif\" alt=\"\" width=\"250\" height=\"134\" \/><p id=\"caption-attachment-442\" class=\"wp-caption-text\">The FS90R servo can spin continuously, making it great for wheel control for smaller robots.<\/p><\/div>\n<p>In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of servo is great is you want to\u00a0 control small wheeled robots or raise or lower winch cables on robots.<\/p>\n<p><strong>Required Components<\/strong><\/p>\n<p><a href=\"https:\/\/amzn.to\/3JUPrMf\">Microbit<\/a><\/p>\n<p><a href=\"https:\/\/amzn.to\/3jExfMh\">Jumper wires<\/a><\/p>\n<p><a href=\"https:\/\/amzn.to\/3RKvVE5\">FS90R Servo<\/a><\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">Wiring<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Wiring Diagram<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-993\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/cont-servo.png\" alt=\"\" width=\"723\" height=\"375\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/cont-servo.png 723w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/cont-servo-300x156.png 300w\" sizes=\"(max-width: 723px) 100vw, 723px\" \/><\/p>\n\n<\/div><h2 class=\"tabtitle\">Circuit<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Circuit Diagram<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large wp-image-994\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-circuit-1024x491.png\" alt=\"\" width=\"750\" height=\"360\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-circuit-1024x491.png 1024w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-circuit-300x144.png 300w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-circuit-768x368.png 768w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-circuit.png 1492w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n\n<\/div><h2 class=\"tabtitle\">Code<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Microbit Blockly Code<\/h3>\n<p>In order to control to the servo you will need to import the servo extension first.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1021\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/servo-extension.png\" alt=\"\" width=\"435\" height=\"141\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/servo-extension.png 435w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/servo-extension-300x97.png 300w\" sizes=\"(max-width: 435px) 100vw, 435px\" \/><\/p>\n<p>Then you can add the following code and download it to your Microbit:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-996\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-code.png\" alt=\"\" width=\"560\" height=\"349\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-code.png 935w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-code-300x187.png 300w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-code-768x479.png 768w\" sizes=\"(max-width: 560px) 100vw, 560px\" \/><\/p>\n\n<\/div><h2 class=\"tabtitle\">Challenge 1<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Challenge 1 &#8211; Random Spinner<\/h3>\n<p>Can you adapt the code so that when you shake the Micro:bit it spins in a random direction at a random speed for 1 second?<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1016\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/random-block.png\" alt=\"\" width=\"337\" height=\"61\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/random-block.png 337w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/random-block-300x54.png 300w\" sizes=\"(max-width: 337px) 100vw, 337px\" \/><\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">2<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Challenge 2 &#8211;\u00a0Speed changer<\/h3>\n<p>Can you adapt the code so that when you press the A button the servo speeds up, when you press the B button the servo slows down and when you press A+B the servo stops<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1017\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-challenge-2-hint.png\" alt=\"\" width=\"711\" height=\"207\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-challenge-2-hint.png 711w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/continuous-servo-challenge-2-hint-300x87.png 300w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">3<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Challenge 3 &#8211; Tilt power<\/h3>\n<p>Can you adapt the code so that the servo spins clockwise or anticlockwise depending on whether you are tilting the Micro:bit left or right. The more it tilts the faster it should go?<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1018\" src=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/accelerometer-block.png\" alt=\"\" width=\"377\" height=\"91\" srcset=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/accelerometer-block.png 377w, https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2023\/01\/accelerometer-block-300x72.png 300w\" sizes=\"(max-width: 377px) 100vw, 377px\" \/><\/p>\n<p><span style=\"font-weight: 400;\"><b>Note: <\/b><\/span><span style=\"font-weight: 400;\">The servo has a power setting between -100 and 100 but the accelerometer has values between -1024 and 1024. How can you convert these values?<\/span><\/p>\n<h3><\/h3>\n\n<\/div><h2 class=\"tabtitle\">Resources<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Resources<\/h3>\n<p>Printable Worksheet<\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of servo is great is you want to\u00a0 control small wheeled robots or raise or lower winch cables on robots. Required Components Microbit Jumper wires FS90R Servo &nbsp;&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Controlling a continuous servo with the Microbit<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"on","neve_meta_content_width":82,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk<\/title>\n<meta name=\"description\" content=\"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk\" \/>\n<meta property=\"og:description\" content=\"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\" \/>\n<meta property=\"og:site_name\" content=\"Microbit\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-08T10:34:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2016\/07\/continuous-servo.gif\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\",\"url\":\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\",\"name\":\"Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#website\"},\"datePublished\":\"2023-01-26T09:56:59+00:00\",\"dateModified\":\"2023-02-08T10:34:01+00:00\",\"description\":\"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Microbit Unit Home\",\"item\":\"https:\/\/learnlearn.uk\/microbit\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Controlling a continuous servo with the Microbit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#website\",\"url\":\"https:\/\/learnlearn.uk\/microbit\/\",\"name\":\"Microbit\",\"description\":\"Tutorials, Projects &amp; Challenges\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/microbit\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#organization\",\"name\":\"Microbit\",\"url\":\"https:\/\/learnlearn.uk\/microbit\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2019\/06\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2019\/06\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"Microbit\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/microbit\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk","description":"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/","og_locale":"en_GB","og_type":"article","og_title":"Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk","og_description":"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of","og_url":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/","og_site_name":"Microbit","article_modified_time":"2023-02-08T10:34:01+00:00","og_image":[{"url":"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2016\/07\/continuous-servo.gif"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/","url":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/","name":"Controlling a continuous servo with the Microbit - Microbit - LearnLearn.co.uk","isPartOf":{"@id":"https:\/\/learnlearn.uk\/microbit\/#website"},"datePublished":"2023-01-26T09:56:59+00:00","dateModified":"2023-02-08T10:34:01+00:00","description":"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/microbit\/continuous-servos\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/microbit\/continuous-servos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Microbit Unit Home","item":"https:\/\/learnlearn.uk\/microbit\/"},{"@type":"ListItem","position":2,"name":"Controlling a continuous servo with the Microbit"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/microbit\/#website","url":"https:\/\/learnlearn.uk\/microbit\/","name":"Microbit","description":"Tutorials, Projects &amp; Challenges","publisher":{"@id":"https:\/\/learnlearn.uk\/microbit\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/microbit\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/microbit\/#organization","name":"Microbit","url":"https:\/\/learnlearn.uk\/microbit\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/microbit\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2019\/06\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/microbit\/wp-content\/uploads\/sites\/2\/2019\/06\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"Microbit"},"image":{"@id":"https:\/\/learnlearn.uk\/microbit\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/microbit\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"Introduction In this experiment we are going to look at how we can control a continuous servo, a type of servo that can spin continuously. This type of servo is great is you want to\u00a0 control small wheeled robots or raise or lower winch cables on robots. Required Components Microbit Jumper wires FS90R Servo &nbsp;&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/pages\/976"}],"collection":[{"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/comments?post=976"}],"version-history":[{"count":14,"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/pages\/976\/revisions"}],"predecessor-version":[{"id":1025,"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/pages\/976\/revisions\/1025"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/microbit\/wp-json\/wp\/v2\/media?parent=976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}