Programming the micro:bit

From Digital Systems
Jump to: navigation, search

We will program the micro:bit on the 'bare metal', allowing us to see (and requiring us to understand) everything about how the hardware works. If we only want to implement an application, then there's no need to tangle with these low-level details.

  • MBED and C++.
    • MBED brings together a lot of things: every MBED device can be programmed by copying files to a simulated disk drive, and there is an online C++ compiler that can generate an object file suitable for each device.
    • From a programming point of view, MBED provides a hardware abstraction layer that hides the details of the I/O system on each microcontroller behind a uniform interface. There's a layer written in C that manipulates the device registers, and around that are wrappers in C++ that follow the idiom that declaring an instance of a class also initialises the attached hardware.
  • Lancaster runtime: provides threads and an event system.
  • Languages on top: Micropython, Blocks, Javascript.
  • Arduino IDE (also effectively C++) with Adafruit libraries.

Phōs gives us the possibility of building applications as families of interacting lightweight processes.