Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/examples/swift-playgrounds/codal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"target": {
"name": "codal-microbit-v2",
"url": "https://github.com/lancaster-university/codal-microbit-v2",
"branch": "master",
"type": "git",
"test_ignore": true,
"dev": true
} ,
"config":{
"MICROBIT_BLE_ENABLED" : 1,
"MICROBIT_BLE_PAIRING_MODE": 1,
"MICROBIT_BLE_DEVICE_INFORMATION_SERVICE": 1,
"MICROBIT_BLE_DFU_SERVICE": 1,
"MICROBIT_BLE_EVENT_SERVICE" : 1,
"MICROBIT_BLE_PARTIAL_FLASHING" : 1,
"MICROBIT_BLE_OPEN": 0,
"MICROBIT_BLE_SECURITY_LEVEL": "SECURITY_MODE_ENCRYPTION_NO_MITM"
}
}
12 changes: 7 additions & 5 deletions source/examples/swift-playgrounds/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ DEALINGS IN THE SOFTWARE.
MicroBit uBit;

const uint8_t small_heart_arr[] {
0, 0, 0, 0, 0,
0, 1, 0, 1, 0,
0, 1, 1, 1, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0, };
0, 0, 0, 0, 0,
0, 255, 0, 255, 0,
0, 255, 255, 255, 0,
0, 0, 255, 0, 0,
0, 0, 0, 0, 0 };

MicroBitImage small_heart(5,5,small_heart_arr);

Expand All @@ -60,6 +60,8 @@ int main()
{
// Initialise the micro:bit runtime.
uBit.init();
uBit.display.setDisplayMode(DISPLAY_MODE_BLACK_AND_WHITE);
uBit.display.setBrightness(255);

// Configuration Tips
// Swift Playgrounds relies on the presence of the DFU service to intiate bonding, so
Expand Down