Samples of how to use the micro:bit DAL with mbed. This is a hg clone of the real git repo that can be found here: https://github.com/lancaster-university/microbit-samples
Dependencies: microbit
Fork of microbit-samples by
Revision 1:2ee7e607faaa, committed 2016-04-08
- Comitter:
- LancasterUniversity
- Date:
- Fri Apr 08 16:53:05 2016 +0100
- Parent:
- 0:56b12ee8c8da
- Child:
- 2:5b2cd31ac474
- Commit message:
- Synchronized with git rev 7a8e36db3f62
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Fri Apr 08 16:53:05 2016 +0100 @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 British Broadcasting Corporation. +This software is provided by Lancaster University by arrangement with the BBC. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Fri Apr 08 16:53:05 2016 +0100 @@ -0,0 +1,24 @@ +# microbit-samples + +A collection of example programs using the micro:bit runtime. + +## Overview + +The micro:bit runtime provides an easy to use environment for programming the BBC micro:bit in the C/C++ language, written by Lancaster University. It contains device drivers for all the hardware capabilities of the micro:bit, and also a suite of runtime mechanisms to make programming the micro:bit easier and more flexible. These range from control of the LED matrix display to peer-to-peer radio communication and secure Bluetooth Low Energy services. The micro:bit runtime is proudly built on the ARM mbed and Nordic nrf51 platforms. + +In addition to supporting development in C/C++, the runtime is also designed specifically to support higher level languages provided by our partners that target the micro:bit. It is currently used as a support library for all the languages on the BBC www.microbit.co.uk website, including Microsoft Block, Microsoft TouchDevelop, Code Kingdoms JavaScript and Micropython languages. + +## Links + +[micro:bit runtime docs](http://lancaster-university.github.io/microbit-docs/) | [microbit-dal](https://github.com/lancaster-university/microbit-dal) | [uBit](https://github.com/lancaster-university/microbit) + +## Build Environments + +| Build Environment | Documentation | +| ------------- |-------------| +| ARM mbed online | http://lancaster-university.github.io/microbit-docs/online-toolchains/#mbed | +| yotta | http://lancaster-university.github.io/microbit-docs/offline-toolchains/#yotta | + +## BBC Community Guidelines + +[BBC Community Guidelines](https://www.microbit.co.uk/help#sect_cg)
--- a/main.cpp Thu Apr 07 00:56:00 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -The MIT License (MIT) -Copyright (c) 2016 British Broadcasting Corporation. -This software is provided by Lancaster University by arrangement with the BBC. -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - -#include "MicroBit.h" - -MicroBit uBit; - -int main() -{ - // Initialise the micro:bit runtime. - uBit.init(); - - // Insert your code here! - uBit.display.scroll("HELLO WORLD! :)"); - - // 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(); -} \ No newline at end of file
--- a/mbed-src.lib Thu Apr 07 00:56:00 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/Lancaster-University/code/mbed-src/#976bf2debae2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/module.json Fri Apr 08 16:53:05 2016 +0100 @@ -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#master" + }, + "targetDependencies": {}, + "bin": "./source" +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source/main.cpp Fri Apr 08 16:53:05 2016 +0100 @@ -0,0 +1,42 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 British Broadcasting Corporation. +This software is provided by Lancaster University by arrangement with the BBC. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + +#include "MicroBit.h" + +MicroBit uBit; + +int main() +{ + // Initialise the micro:bit runtime. + uBit.init(); + + // Insert your code here! + uBit.display.scroll("HELLO WORLD! :)"); + + // 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(); +}