for camera
Dependencies: BLE_API mbed nRF51822
Fork of BLE_GATT_Example by
Diff: main.cpp
- Revision:
- 31:e28a1c47859a
- Parent:
- 30:27466f74458c
- Child:
- 32:f775b63b66f9
--- a/main.cpp Sat Jun 10 03:13:53 2017 +0000 +++ b/main.cpp Sat Jun 10 20:34:31 2017 +0000 @@ -1,7 +1,7 @@ #include "mbed.h" #include "ble/BLE.h" -DigitalOut led(P0_8, 1); +DigitalOut led(P0_4, 0); uint16_t customServiceUUID = 0xA000; uint16_t readCharUUID = 0xA001; uint16_t writeCharUUID = 0xA002; @@ -21,7 +21,7 @@ */ void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *) { - led = 1; // just in case + led = 0; // just in case BLE::Instance(BLE::DEFAULT_INSTANCE).gap().startAdvertising(); } @@ -33,9 +33,9 @@ /* Check to see what characteristic was written, by handle */ if(params->handle == writeChar.getValueHandle()) { // since LED is pullup mode - led = 0; + led = 1; wait(1.0); - led = 1; + led = 0; } }