{"id":1516,"date":"2019-04-01T20:40:40","date_gmt":"2019-04-01T19:40:40","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1516"},"modified":"2019-04-01T20:41:12","modified_gmt":"2019-04-01T19:41:12","slug":"ev3-and-microbit","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2019\/ev3-and-microbit","title":{"rendered":"EV3 and micro:bit"},"content":{"rendered":"\n<p>Almost 2 and a half years ago I bought a <a href=\"https:\/\/microbit.org\/\">BBC micro:bit<\/a>, planning to give it as a xmas present to my geek nephew.   Unfortunately (for him) I decided that he wasn&#8217;t geek enough for this small ARM-based controller as I found out it was too confusing to set it up properly for BLE usage.<\/p>\n\n\n\n<p>At that time I managed to get EV3 working with it but it was very awkward. Most of my problems were related to making a proper connection because the firmware required BT to be paired before accepting BLE commands but I also had problemas with the python BLE library I was using (gattlib).<\/p>\n\n\n\n<p>This weekend I had a long day at work upgrading some Microsoft servers and had the time, between downloads and reboots (argh!) to return to this little fellow.  So I found out it is now much, much easier to configure it&#8230; thanks to Microsoft! Yes, same Microsoft.<\/p>\n\n\n\n<p>I used <a href=\"https:\/\/makecode.microbit.org\/#editor\">Makecode Editor<\/a> to configure my micro:bit  from a browser: just added the Bluetooth extension, included th e Bluetooth blocks that activate the proper BLE services and enabled using BLE without the need to pair BT first.<\/p>\n\n\n\n<p>On the ev3dev side it was also easy to use it with python but with a different library: <a href=\"https:\/\/github.com\/peplin\/pygatt\">pygatt<\/a>.<\/p>\n\n\n\n<p>Interestingly, a new version of pygatt was released this very same weekend.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/JorgePe\/microbit\">Details and code samples<\/a> at another Microsoft site (github).<\/p>\n\n\n\n<p>Two demo videos:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>using the two buttons to control a Medium motor:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Micro:bit and EV3 (2)\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/7sGR8Ce65QA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>using the LED Matrix:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Micro:bit and EV3 (3)\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/AHGr_eLJYz0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Almost 2 and a half years ago I bought a BBC micro:bit, planning to give it as a xmas present to my geek nephew. Unfortunately (for him) I decided that he wasn&#8217;t geek enough for this small ARM-based controller as I found out it was too confusing to set it up properly for BLE usage. &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2019\/ev3-and-microbit\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;EV3 and micro:bit&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[38,13,157,98],"tags":[350],"series":[],"class_list":["post-1516","post","type-post","status-publish","format-standard","hentry","category-ble","category-ev3dev","category-ev3dev-en","category-python","tag-microbit"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-os","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1516"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1516\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1516"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}