microbit-samples: Added an example using our new, componentised DAL.

This commit is contained in:
James Devine 2016-03-24 14:51:13 +00:00
parent 1d39a50e2a
commit e8b37cb2fc
4 changed files with 35 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
build
.yotta.json
yotta_targets
yotta_modules

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# microbit-samples
[insert documentation URL here, when we are live]

11
module.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "microbit-samples",
"version": "0.0.1",
"description": "The micro:bit runtime common abstraction with examples.",
"license": "MIT",
"dependencies": {
"microbit": "lancaster-university/microbit#component-refactor"
},
"targetDependencies": {},
"bin": "./source"
}

17
source/main.cpp Normal file
View File

@ -0,0 +1,17 @@
#include "MicroBit.h"
MicroBit uBit;
int main()
{
// Initialise the micro:bit runtime.
uBit.init();
// Insert your code here!
uBit.display.scroll("BELLO! :)");
// If main exits, there may still be other fibers running or registered event handlers etc.
// Simply release this fiber, which will mean we enter the scheduler. Worse case, we then
// sit in the idle task forever, in a power efficient sleep.
release_fiber();
}