example firmware for nRF51-Dongle to use with Opentrigger
Dependencies: BLE_API mbed nRF51822
Fork of BLE_Button by
Diff: main.cpp
- Revision:
- 18:2b328834f64f
- Parent:
- 17:33d38b30e640
- Child:
- 19:3807de5c6a58
--- a/main.cpp Tue Jun 14 18:04:25 2016 +0000 +++ b/main.cpp Tue Jun 14 18:14:30 2016 +0000 @@ -225,13 +225,17 @@ buttonState = IDLE; } - // stop advertising after 3 cycles + + // start advertising if(cnt < 1){ ble.gap().startAdvertising(); led3 = !1; }else if(cnt == 1){ updateManufacturerData(); - }else if(cnt > 3){ + } + + // stop advertising after 3 cycles + if(cnt > 3){ ble.gap().stopAdvertising(); led3 = !0; }else{