Example for BBC Micro:bit
Fork of microbit-samples by
source/MicroBitSamples.h@3:a83c8b471f07, 2016-04-08 (annotated)
- Committer:
- LancasterUniversity
- Date:
- Fri Apr 08 16:59:45 2016 +0100
- Revision:
- 3:a83c8b471f07
- Parent:
- 2:5b2cd31ac474
Synchronized with git rev 73f82275
Author: Joe Finney
microbit-samples: Update to make HelloWorld the default sample
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LancasterUniversity | 2:5b2cd31ac474 | 1 | /* |
LancasterUniversity | 2:5b2cd31ac474 | 2 | The MIT License (MIT) |
LancasterUniversity | 2:5b2cd31ac474 | 3 | |
LancasterUniversity | 2:5b2cd31ac474 | 4 | Copyright (c) 2016 British Broadcasting Corporation. |
LancasterUniversity | 2:5b2cd31ac474 | 5 | This software is provided by Lancaster University by arrangement with the BBC. |
LancasterUniversity | 2:5b2cd31ac474 | 6 | |
LancasterUniversity | 2:5b2cd31ac474 | 7 | Permission is hereby granted, free of charge, to any person obtaining a |
LancasterUniversity | 2:5b2cd31ac474 | 8 | copy of this software and associated documentation files (the "Software"), |
LancasterUniversity | 2:5b2cd31ac474 | 9 | to deal in the Software without restriction, including without limitation |
LancasterUniversity | 2:5b2cd31ac474 | 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
LancasterUniversity | 2:5b2cd31ac474 | 11 | and/or sell copies of the Software, and to permit persons to whom the |
LancasterUniversity | 2:5b2cd31ac474 | 12 | Software is furnished to do so, subject to the following conditions: |
LancasterUniversity | 2:5b2cd31ac474 | 13 | |
LancasterUniversity | 2:5b2cd31ac474 | 14 | The above copyright notice and this permission notice shall be included in |
LancasterUniversity | 2:5b2cd31ac474 | 15 | all copies or substantial portions of the Software. |
LancasterUniversity | 2:5b2cd31ac474 | 16 | |
LancasterUniversity | 2:5b2cd31ac474 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
LancasterUniversity | 2:5b2cd31ac474 | 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
LancasterUniversity | 2:5b2cd31ac474 | 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
LancasterUniversity | 2:5b2cd31ac474 | 20 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
LancasterUniversity | 2:5b2cd31ac474 | 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
LancasterUniversity | 2:5b2cd31ac474 | 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
LancasterUniversity | 2:5b2cd31ac474 | 23 | DEALINGS IN THE SOFTWARE. |
LancasterUniversity | 2:5b2cd31ac474 | 24 | */ |
LancasterUniversity | 2:5b2cd31ac474 | 25 | |
LancasterUniversity | 2:5b2cd31ac474 | 26 | #ifndef MICROBIT_SAMPLES_H |
LancasterUniversity | 2:5b2cd31ac474 | 27 | #define MICROBIT_SAMPLES_H |
LancasterUniversity | 2:5b2cd31ac474 | 28 | |
LancasterUniversity | 2:5b2cd31ac474 | 29 | |
LancasterUniversity | 2:5b2cd31ac474 | 30 | // |
LancasterUniversity | 2:5b2cd31ac474 | 31 | // Uncomment ONE of the following #defines to select which sample to build. |
LancasterUniversity | 2:5b2cd31ac474 | 32 | // Afterwards, save this file and build the project. The resulting HEX |
LancasterUniversity | 2:5b2cd31ac474 | 33 | // file will contain your chosen sample. |
LancasterUniversity | 2:5b2cd31ac474 | 34 | // |
LancasterUniversity | 2:5b2cd31ac474 | 35 | |
LancasterUniversity | 2:5b2cd31ac474 | 36 | |
LancasterUniversity | 2:5b2cd31ac474 | 37 | // |
LancasterUniversity | 2:5b2cd31ac474 | 38 | // Introductory examples using the uBit object. |
LancasterUniversity | 2:5b2cd31ac474 | 39 | // |
LancasterUniversity | 2:5b2cd31ac474 | 40 | |
LancasterUniversity | 3:a83c8b471f07 | 41 | #define MICROBIT_SAMPLE_HELLO_WORLD |
LancasterUniversity | 2:5b2cd31ac474 | 42 | //#define MICROBIT_SAMPLE_ACCELEROMETER_DEMO |
LancasterUniversity | 2:5b2cd31ac474 | 43 | //#define MICROBIT_SAMPLE_BUTTON_EVENTS |
LancasterUniversity | 2:5b2cd31ac474 | 44 | //#define MICROBIT_SAMPLE_SIMPLE_ANIMATION |
LancasterUniversity | 3:a83c8b471f07 | 45 | //#define MICROBIT_SAMPLE_GREYSCALE |
LancasterUniversity | 2:5b2cd31ac474 | 46 | //#define MICROBIT_SAMPLE_LOGIC_GATES |
LancasterUniversity | 2:5b2cd31ac474 | 47 | //#define MICROBIT_SAMPLE_SNAKE |
LancasterUniversity | 2:5b2cd31ac474 | 48 | |
LancasterUniversity | 2:5b2cd31ac474 | 49 | // |
LancasterUniversity | 2:5b2cd31ac474 | 50 | // Examples using MicroBitRadio. |
LancasterUniversity | 2:5b2cd31ac474 | 51 | // |
LancasterUniversity | 2:5b2cd31ac474 | 52 | // n.b. you MUST disable the BLE stack to run these samples. |
LancasterUniversity | 2:5b2cd31ac474 | 53 | // Do this by setting "#define MICROBIT_BLE_ENABLED 0" in your MicroBitConfig.h file. |
LancasterUniversity | 2:5b2cd31ac474 | 54 | // |
LancasterUniversity | 2:5b2cd31ac474 | 55 | // For yotta based environments this file is located at: |
LancasterUniversity | 2:5b2cd31ac474 | 56 | // "yotta_modules/microbit-dal/inc/core/MicroBitConfig.h" |
LancasterUniversity | 2:5b2cd31ac474 | 57 | // |
LancasterUniversity | 2:5b2cd31ac474 | 58 | // For project compiling on mbed.org, it is located at: |
LancasterUniversity | 2:5b2cd31ac474 | 59 | // "microbit/microbit-dal/inc/core/MicroBitConfig.h" |
LancasterUniversity | 2:5b2cd31ac474 | 60 | // |
LancasterUniversity | 2:5b2cd31ac474 | 61 | |
LancasterUniversity | 2:5b2cd31ac474 | 62 | //#define MICROBIT_SAMPLE_SIMPLE_RADIO_TX |
LancasterUniversity | 2:5b2cd31ac474 | 63 | //#define MICROBIT_SAMPLE_SIMPLE_RADIO_RX |
LancasterUniversity | 2:5b2cd31ac474 | 64 | |
LancasterUniversity | 2:5b2cd31ac474 | 65 | |
LancasterUniversity | 2:5b2cd31ac474 | 66 | #endif |