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