{"id":4751,"date":"2017-01-27T13:38:38","date_gmt":"2017-01-27T13:38:38","guid":{"rendered":"http:\/\/www.dyalog.com\/blog\/?p=4751"},"modified":"2017-03-21T13:41:05","modified_gmt":"2017-03-21T13:41:05","slug":"morse-code-revisited-using-the-bbc-microbit","status":"publish","type":"post","link":"https:\/\/www.dyalog.com\/blog\/2017\/01\/morse-code-revisited-using-the-bbc-microbit\/","title":{"rendered":"Morse Code &#8211; Revisited using the BBC micro:bit"},"content":{"rendered":"<p>As mentioned <a title=\"Raspberry APL Pi and Python on the micro:bit\" href=\"http:\/\/www.dyalog.com\/blog\/2017\/01\/raspberry-apl-pi-and-python-on-the-microbit-2\/\">last week<\/a>, I have found a new way to provide a front end processor for my Pi, the BBC micro:bit. This week, I have started putting the new system through its paces: The microbit class in our <a title=\"GitHub APLPi\/microbit repository\" href=\"https:\/\/github.com\/APLPi\/microbit\" target=\"_blank\">GitHub repository<\/a> has been beefed up to make it more resilient in the case where serial I\/O is not initialised, or the MicroPython REPL is not running, and I have added <a title=\"repl_prompt.py\" href=\"https:\/\/github.com\/APLPi\/microbit\/blob\/master\/repl_prompt.py\" target=\"_blank\">a trivial Python program<\/a> which can be used to intialise the REPL using the <a title=\"https:\/\/codewith.mu\/\" href=\"https:\/\/codewith.mu\/\" target=\"_blank\">mu editor<\/a>.<\/p>\n<p>To test it all, I have revisited the <a title=\"GPIO Morse Code\" href=\"https:\/\/github.com\/APLPi\/GPIO\/blob\/master\/Morse.dyalog\" target=\"_blank\">Morse Code example, originally written to use GPIO support provided by Quick2Wire<\/a>, to see if I could get it up and running with my new infrastructure. The micro:bit has a 5&#215;5 LED display which makes the result a bit more impressive to look at:<\/p>\n<iframe loading=\"lazy\"  id=\"_ytid_13693\"  width=\"584\" height=\"329\"  data-origwidth=\"584\" data-origheight=\"329\"  src=\"https:\/\/www.youtube.com\/embed\/yfGsSLEifAs?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=0&rel=1&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=1&\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  allow=\"autoplay; encrypted-media\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe>\n<p>&nbsp;<\/p>\n<p>The new code is significantly simpler than the original, for a couple of reasons:<\/p>\n<ol>\n<li>Making calls to the micro:bit API via MicroPython is easier than using GPIO via a C library.<\/li>\n<li>Version 15.0 of Dyalog APL contains new system functions for working with text files, so we no longer need the &#8220;Files&#8221; library, we can just use the <a title=\"\u2395NGET at help.dyalog.com\" href=\"http:\/\/help.dyalog.com\/15.0\/index_Left.htm#CSHID=Language%2FSystem%20Functions%2Fnget.htm|StartTopic=Content%2FLanguage%2FSystem%20Functions%2Fnget.htm|SkinName=Default\" target=\"_blank\">built-in \u2395NGET function<\/a> to read the contents of a file.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>As mentioned last week, I have found a new way to provide a front end processor for my Pi, the BBC micro:bit. This week, I have started putting the new system through its paces: The microbit class in our GitHub &hellip; <a href=\"https:\/\/www.dyalog.com\/blog\/2017\/01\/morse-code-revisited-using-the-bbc-microbit\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,9],"tags":[],"class_list":["post-4751","post","type-post","status-publish","format-standard","hentry","category-cxo","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/4751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/comments?post=4751"}],"version-history":[{"count":8,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/4751\/revisions"}],"predecessor-version":[{"id":4874,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/4751\/revisions\/4874"}],"wp:attachment":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/media?parent=4751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/categories?post=4751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/tags?post=4751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}