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
Revision 2:d95ef4a128c5, committed 2015-03-12
- Comitter:
- nitram509
- Date:
- Thu Mar 12 23:02:10 2015 +0000
- Parent:
- 1:81a97eb70d3d
- Commit message:
- changed the control for "Digital Out" that it controls the onboard LED
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- 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) {
--- a/mbed.bld Fri Oct 31 14:44:32 2014 +0000 +++ b/mbed.bld Thu Mar 12 23:02:10 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/cb3d968589d8 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf \ No newline at end of file