the start of some experimentation
Revision 0:772b1f247008, committed 2019-10-19
- Comitter:
- matrixmike
- Date:
- Sat Oct 19 08:06:36 2019 +0000
- Commit message:
- initial commit
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
microbit.lib | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Oct 19 08:06:36 2019 +0000 @@ -0,0 +1,24 @@ +/* See + * http://lancaster-university.github.io/microbit-docs/advanced/ + * for docs about using the micro:bit library +*/ +#include "MicroBit.h" + +MicroBitMessageBus bus; +MicroBitButton buttonA(MICROBIT_PIN_BUTTON_A, MICROBIT_ID_BUTTON_A); +MicroBitDisplay display; + +void onPressed(MicroBitEvent e) +{ + display.print("S"); +} + +int main() +{ + scheduler_init(bus); + + bus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onPressed); + + while(1) + fiber_sleep(1000); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microbit.lib Sat Oct 19 08:06:36 2019 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/Lancaster-University/code/microbit/#4b89e7e3494f