{"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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">Interestingly, a new version of pygatt was released this very same weekend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/JorgePe\/microbit\">Details and code samples<\/a> at another Microsoft site (github).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/7sGR8Ce65QA?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=pt-PT&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\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<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/AHGr_eLJYz0?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=pt-PT&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"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_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-os","jetpack_featured_media_url":"","_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}]}}