美文网首页
micro:bit 软件生态系统介绍

micro:bit 软件生态系统介绍

作者: chiyang2004 | 来源:发表于2017-06-12 08:01 被阅读0次

    micro:bit 软件生态系统介绍

    这里有大量的软件平台及工具使得许多microbit计划顺利的进行,这篇文章只是做概略介绍而希望要进一步了解可以到不同计划的专页得到更多的数据.

    Microbit Shop

    Overview

    ·High Level Programming Languages高阶程序语言

    oCompiled Languages编译语言

    oInterpreted Langauges直译语言

    ·Coding environments and IDEs程序环境及整合接口

    ·From Coding Environment to micro:bit从程序环境到microbit

    ·micro:bit Low Level (C/C++) Software

    Stack底层软件架构

    在microbit软件分成在microbit (Target Computer如下图右边)上执行的及主计算机(Host Computer如下图左边)上两类:

    一般程序写好后透过USB转到micro:bit,整个流程由两个芯片完成,一是KL26Z负责程序刷新(code flashing),另一nRF51822则执行完成用户完成的程序。

    高阶程序语言

    Microbit的高阶程序语言分成编译及直译两类(但译者若以实际的程序执行环境目前都是"编译”── 将用户程序编译后结合底层已有bytebode,成为完整执行程序),原文便保留

    The ‘high level’ programming languages for the

    micro:bit break down into two broad categories

    ·Compiled languages: your

    program is compiled to ARM assembler or some other kind of bytecode before

    being copied onto the micro:bit.

    ·Interpreted Languages: both

    your script and an interpreter for it are copied onto the micro:bit. Because the

    interpreter is on the micro:bit itself, these langauges typically also allow

    you to program the micro:bit ‘live’ over USB by typing commands.

    编译语言

    C/C++, while certainly compiled, is not considered a high-level language

    in this context

    为了可以确定在线的编译环境可支持一百万片microbit的板子,微软用TypeScript写了浏览器版编译程序,在这编译程序上微软使用了以下的技术 :

    ·Blocks (at microbit.co.uk)

    ·TouchDevelop

    ·CodeKingdoms Javascript (at

    microbit.co.uk)

    ·Blocks and Javascript as part

    ofpxt(at pxt.microbit.org)

    整个完整流程说明在浏览器编译页面In browser compiler,更细部令人惊艳的细节在TouchDevelop in 208 bits.

    浏览编译程序不会编译整个程序,只有用户编写的部分,其他底层执行的部分已经预先用mbed编译好,并整合进在线编译程序。当用户编写完他的程序,编译程序便会编译并结合底层软件,让用户下载!

    .

    直译语言

    在microbit.co.uk正式的编译程序中,只有Python是直译的。这是用MicroPython直译器项目所完成,细部数据可以MicroPython的连结中找到。

    另外还有Javascript直译器项目port of the Javascript interpreter Espruino支持microbit!

    程序环境及整合接口

    这里有许多程序环境可让用户对microbit做不同层面的程序设计.

    较普遍的编译环境都列在https://microbit.org/code,脱机的编译环境有Mu offline Python editor

    这里已经尽可能将micro bit相关的编译环境列出来,若你有知道,但不在这上面的,请让我们知道(Here’s a non-exhaustive list of possible code editors for use with themicro:bit.please add any you know about that are not here,原文中并未指出如何通知,所以在这将原文列出)

    ·microbit.co.uk editors based

    on TouchDevelop backend:

    oCode Kingdoms Javascript

    oMicrosoft Blocks

    oMicrosoft TouchDevelop

    oPython

    ·mbed Online Compiler

    ·Mu offline Python editor

    ·PXT for micro:bit(successor

    to the TouchDevelop-based editors above)

    从程序环境到micro:bit

    每一个编译环境都会产生一个.hex的档案,这是microbit可以认得的格式。由于主计算机会将Microbit认为是USB随身碟(是由DAPLink模拟出来),当编译出来Hex檔拖拉至microbit。当闪灯结束,程序便开始执行。

    另一"刷程序"(flash’ code)是用手机AP透过蓝芽传输至micro:bit,更多的信息请参考here,有关蓝芽手机程序更多信息请参考here

    micro:bit底层软件架构

    当你为microbit写完你的应用程序,刷你的程序进microbit。这hex档除了包含你写的部分也包含了许多底成软件模块,这些软件模块在底下一、一做介绍:

    ·the micro:bit Runtime(有时称这部分为装置抽象层),是由Lancaster University用C++写成。装置抽象层形成不同语言共同使用的部分,但在不同语言下使用的频繁度及包装的紧密度不同。(有兴趣的读者可以用以下列处的链接下载语言编译程序的程序代码研究,或初步去看各语言的reference作了解)

    ·ARM mbed这部分提供了mbed对不同ARM based MCU的周边有标准的SDK,这也包含了BLE的抽象层及API,这也代表的microbit的软件可以执行在其他的mbed支持的硬件上

    ·Nordic nRF51-SDKmbed是建构在Nordic nRF51-SDK的上层,由Nordic发展的组件可以帮助程序人员使用它们的硬件。

    ·MicroPython interpreter若你是使用python的程序人员,它是用micro python及mbed开发出来的,所以microPython是可以使用在许多不同硬件平台

    Micro:bit

    中文台湾

    相关文章

      网友评论

          本文标题:micro:bit 软件生态系统介绍

          本文链接:https://www.haomeiwen.com/subject/qpnkqxtx.html