// we use events abd the 'connected' variable to keep track of the status of the Bluetooth connection
voidonConnected(MicroBitEvente)
voidonConnected(MicroBitEvent)
{
uBit.display.print("C");
}
voidonDisconnected(MicroBitEvente)
voidonDisconnected(MicroBitEvent)
{
uBit.display.print("D");
}
@ -56,12 +56,12 @@ int main()
// "tx_power": 7, // Transmission power of the Bluetooth radio. A value of 0 - 7 with 0 the lowest power and 7 the highest power.
// "gatt_table_size": "0x700" // Amount of memory (in hex bytes) set aside for the Bluetooth GATT table
// "nested_heap_proportion": 0.75, // Reducing this can sometimes help make enough memory available for all the Bluetooth services you want. Only experiment with this as a last resort.
// MicrobitConfig.h in yotta_modules\microbit-dal\inc\core contains MICROBIT_BLE_SECURITY_LEVEL which can be set to SECURITY_MODE_ENCRYPTION_WITH_MITM for passkey authentication when
// pairing or SECURITY_MODE_ENCRYPTION_NO_MITM to use Just Works pairing.
// A cunning code to indicate during start-up the particular Bluetooth configuration in the build
//
//
// SERVICE CODES
// A: Accelerometer Service
// B: Button Service
@ -76,15 +76,15 @@ int main()
//
// PAIRING CONFIG
// Note that switching pairing on or off is achieved by setting "open" in config.json to 1 or 0 respectively