
BLE mouse with uBit ( still some issues to resolve )
Dependencies: BLE_API mbed nRF51822
Fork of microbit_presenter by
Diff: keyboard_stream.cpp
- Revision:
- 1:9e174f8fd9e9
- Parent:
- 0:cb1939018833
--- a/keyboard_stream.cpp Mon Nov 02 18:25:58 2015 +0000 +++ b/keyboard_stream.cpp Wed Aug 31 18:59:58 2016 +0000 @@ -32,9 +32,12 @@ * KeyboardService uses a circular buffer to store the strings to send, and calls to putc will fail * once this buffer is full. This will result in partial strings being sent to the client. */ + + //The micro:bit has a matrixed display, this is a simple way to use some LEDs on it +DigitalOut col9(P0_12, 0); -DigitalOut waiting_led(LED1); -DigitalOut connected_led(LED2); +DigitalOut waiting_led(P0_13); +DigitalOut connected_led(P0_15); InterruptIn button1(BUTTON_A); InterruptIn button2(BUTTON_B); @@ -42,7 +45,7 @@ BLE ble; KeyboardService *kbdServicePtr; -static const char DEVICE_NAME[] = "microbitkb"; +static const char DEVICE_NAME[] = "micro:bit Presenter"; static const char SHORT_DEVICE_NAME[] = "kbd1"; static void onDisconnect(const Gap::DisconnectionCallbackParams_t *params) @@ -119,6 +122,7 @@ (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, (uint8_t *)SHORT_DEVICE_NAME, sizeof(SHORT_DEVICE_NAME)); + ble.gap().setDeviceName((const uint8_t *)DEVICE_NAME); HID_DEBUG("advertising\r\n"); ble.gap().startAdvertising();