Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MicroBitDALImageRewrite by
MicroBit.cpp@0:47d8ba08580f, 2015-04-12 (annotated)
- Committer:
- finneyj
- Date:
- Sun Apr 12 17:38:56 2015 +0000
- Revision:
- 0:47d8ba08580f
- Child:
- 1:3e0360107f98
First draft implementation of core functionality. Includes:; ; - OO model of microBit device.; - Flexible geometry LD matirx driver.; - Lazy, instatiation free I/O; ; Please note this code is largely untested.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
finneyj | 0:47d8ba08580f | 1 | #include "inc/MicroBit.h" |
finneyj | 0:47d8ba08580f | 2 | |
finneyj | 0:47d8ba08580f | 3 | |
finneyj | 0:47d8ba08580f | 4 | /** |
finneyj | 0:47d8ba08580f | 5 | * Device level Message Bus abstraction |
finneyj | 0:47d8ba08580f | 6 | */ |
finneyj | 0:47d8ba08580f | 7 | |
finneyj | 0:47d8ba08580f | 8 | void (*MicroBit::messageBus)(MicroBitEvent *) = NULL; |
finneyj | 0:47d8ba08580f | 9 | |
finneyj | 0:47d8ba08580f | 10 | |
finneyj | 0:47d8ba08580f | 11 | |
finneyj | 0:47d8ba08580f | 12 | void MicroBit::init() |
finneyj | 0:47d8ba08580f | 13 | { |
finneyj | 0:47d8ba08580f | 14 | |
finneyj | 0:47d8ba08580f | 15 | } |
finneyj | 0:47d8ba08580f | 16 | |
finneyj | 0:47d8ba08580f | 17 | |
finneyj | 0:47d8ba08580f | 18 | |
finneyj | 0:47d8ba08580f | 19 | /** |
finneyj | 0:47d8ba08580f | 20 | * Constructor. |
finneyj | 0:47d8ba08580f | 21 | * Create a representation of a MicroBit device. |
finneyj | 0:47d8ba08580f | 22 | * @param messageBus callback function to receive MicroBitMessageBus events. |
finneyj | 0:47d8ba08580f | 23 | */ |
finneyj | 0:47d8ba08580f | 24 | MicroBit::MicroBit(void (*messageBus)(MicroBitEvent *)) : |
finneyj | 0:47d8ba08580f | 25 | userLED(MICROBIT_ID_USER_LED, MICROBIT_PIN_USER_LED), |
finneyj | 0:47d8ba08580f | 26 | display(MICROBIT_ID_DISPLAY, 5, 5) |
finneyj | 0:47d8ba08580f | 27 | |
finneyj | 0:47d8ba08580f | 28 | { |
finneyj | 0:47d8ba08580f | 29 | // Just store this for later. |
finneyj | 0:47d8ba08580f | 30 | init(); |
finneyj | 0:47d8ba08580f | 31 | MicroBit::messageBus = messageBus; |
finneyj | 0:47d8ba08580f | 32 | } |