Funciona no redbear
Dependencies: BLE_API mbed nRF51822
Fork of BLE_LED_Controller by
Revision 17:3a1cd75f0f78, committed 2016-08-30
- Comitter:
- vgoliveira
- Date:
- Tue Aug 30 02:21:02 2016 +0000
- Parent:
- 16:bfbf1982815e
- Commit message:
- Finalmente um c?digo que funciona;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r bfbf1982815e -r 3a1cd75f0f78 main.cpp --- a/main.cpp Tue Aug 30 01:54:17 2016 +0000 +++ b/main.cpp Tue Aug 30 02:21:02 2016 +0000 @@ -28,15 +28,15 @@ #define DEBUG(...) /* nothing */ #endif /* #if NEED_CONSOLE_OUTPUT */ -#define LED2CMD "led2" +#define CMD "led2" #define CMD_LENGTH 4 //char rxPayload[CMD_SIZE]; BLEDevice ble; // Create Bluetooth object -DigitalOut led1(P0_19); // Set the pin attached to LED1 as an output -PwmOut led2(LED2); // Set the pin attached to LED2 as an output +DigitalOut led1(LED1); // Set the pin attached to LED1 as an output +PwmOut led2(); // Set the pin attached to as an output UARTService *uartServicePtr; @@ -56,7 +56,7 @@ DEBUG("Received string: '"); DEBUG((const char *)params->data); //Note the size of data expands to the largest string received. Need to use bytesRead to resize. DEBUG("'\n\r"); - if (!strncmp(LED2CMD,(const char *)params->data,CMD_LENGTH-1)){ + if (!strncmp(CMD,(const char *)params->data,CMD_LENGTH-1)){ float value; char cmd[CMD_LENGTH]; sscanf((const char *)params->data, "%s %f", cmd, &value );