SimpleControls works with the BLEController iOS/Android App. The BLE Controll App will allow you to switch the onboard LED on/off with the control named 'Digital Out pin2'
Dependencies: BLE_API mbed nRF51822
Fork of BLENano_SimpleControls by
Diff: main.cpp
- Revision:
- 2:d95ef4a128c5
- Parent:
- 1:81a97eb70d3d
--- a/main.cpp Fri Oct 31 14:44:32 2014 +0000 +++ b/main.cpp Thu Mar 12 23:02:10 2015 +0000 @@ -37,6 +37,7 @@ BLEDevice ble; DigitalOut LED_SET(DIGITAL_OUT_PIN); +DigitalOut ONBOARD_LED(P0_19); DigitalIn BUTTON(DIGITAL_IN_PIN); PwmOut PWM(PWM_PIN); AnalogIn ANALOG(ANALOG_IN_PIN); @@ -95,9 +96,11 @@ if(buf[0] == 0x01) { if(buf[1] == 0x01) - LED_SET = 1; + // LED_SET = 1; + ONBOARD_LED = 0; else - LED_SET = 0; + // LED_SET = 0; + ONBOARD_LED = 1; } else if(buf[0] == 0xA0) { @@ -211,6 +214,7 @@ ble.startAdvertising(); //pc.printf("Advertising Start \r\n"); + ONBOARD_LED = 1; while(1) {