x
main.cpp@1:89e02f714b5b, 2017-06-06 (annotated)
- Committer:
- bluetooth_mdw
- Date:
- Tue Jun 06 08:43:27 2017 +0000
- Revision:
- 1:89e02f714b5b
- Parent:
- 0:0842ae275ae0
x
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bluetooth_mdw | 0:0842ae275ae0 | 1 | /* |
bluetooth_mdw | 0:0842ae275ae0 | 2 | The MIT License (MIT) |
bluetooth_mdw | 0:0842ae275ae0 | 3 | |
bluetooth_mdw | 0:0842ae275ae0 | 4 | Copyright (c) 2016 British Broadcasting Corporation. |
bluetooth_mdw | 0:0842ae275ae0 | 5 | This software is provided by Lancaster University by arrangement with the BBC. |
bluetooth_mdw | 0:0842ae275ae0 | 6 | |
bluetooth_mdw | 0:0842ae275ae0 | 7 | Permission is hereby granted, free of charge, to any person obtaining a |
bluetooth_mdw | 0:0842ae275ae0 | 8 | copy of this software and associated documentation files (the "Software"), |
bluetooth_mdw | 0:0842ae275ae0 | 9 | to deal in the Software without restriction, including without limitation |
bluetooth_mdw | 0:0842ae275ae0 | 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
bluetooth_mdw | 0:0842ae275ae0 | 11 | and/or sell copies of the Software, and to permit persons to whom the |
bluetooth_mdw | 0:0842ae275ae0 | 12 | Software is furnished to do so, subject to the following conditions: |
bluetooth_mdw | 0:0842ae275ae0 | 13 | |
bluetooth_mdw | 0:0842ae275ae0 | 14 | The above copyright notice and this permission notice shall be included in |
bluetooth_mdw | 0:0842ae275ae0 | 15 | all copies or substantial portions of the Software. |
bluetooth_mdw | 0:0842ae275ae0 | 16 | |
bluetooth_mdw | 0:0842ae275ae0 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
bluetooth_mdw | 0:0842ae275ae0 | 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
bluetooth_mdw | 0:0842ae275ae0 | 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
bluetooth_mdw | 0:0842ae275ae0 | 20 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
bluetooth_mdw | 0:0842ae275ae0 | 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
bluetooth_mdw | 0:0842ae275ae0 | 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
bluetooth_mdw | 0:0842ae275ae0 | 23 | DEALINGS IN THE SOFTWARE. |
bluetooth_mdw | 0:0842ae275ae0 | 24 | */ |
bluetooth_mdw | 0:0842ae275ae0 | 25 | |
bluetooth_mdw | 0:0842ae275ae0 | 26 | #include "MicroBit.h" |
bluetooth_mdw | 0:0842ae275ae0 | 27 | |
bluetooth_mdw | 0:0842ae275ae0 | 28 | MicroBit uBit; |
bluetooth_mdw | 0:0842ae275ae0 | 29 | |
bluetooth_mdw | 0:0842ae275ae0 | 30 | int main() |
bluetooth_mdw | 0:0842ae275ae0 | 31 | { |
bluetooth_mdw | 0:0842ae275ae0 | 32 | // Initialise the micro:bit runtime. |
bluetooth_mdw | 0:0842ae275ae0 | 33 | uBit.init(); |
bluetooth_mdw | 0:0842ae275ae0 | 34 | |
bluetooth_mdw | 0:0842ae275ae0 | 35 | // Insert your code here! |
bluetooth_mdw | 0:0842ae275ae0 | 36 | uBit.display.scroll("PAIR ME"); |
bluetooth_mdw | 0:0842ae275ae0 | 37 | |
bluetooth_mdw | 0:0842ae275ae0 | 38 | // If main exits, there may still be other fibers running or registered event handlers etc. |
bluetooth_mdw | 0:0842ae275ae0 | 39 | // Simply release this fiber, which will mean we enter the scheduler. Worse case, we then |
bluetooth_mdw | 0:0842ae275ae0 | 40 | // sit in the idle task forever, in a power efficient sleep. |
bluetooth_mdw | 0:0842ae275ae0 | 41 | release_fiber(); |
bluetooth_mdw | 0:0842ae275ae0 | 42 | } |
bluetooth_mdw | 0:0842ae275ae0 | 43 |