Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_Basic by
Revision 3:e2d0b055d8f2, committed 2016-03-07
- Comitter:
- tucanae47
- Date:
- Mon Mar 07 21:05:26 2016 +0000
- Parent:
- 2:8f2c349db7dd
- Commit message:
- remove sensor
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8f2c349db7dd -r e2d0b055d8f2 main.cpp
--- a/main.cpp Mon Jun 08 10:03:31 2015 +0000
+++ b/main.cpp Mon Mar 07 21:05:26 2016 +0000
@@ -25,12 +25,13 @@
BLEDevice ble;
DigitalOut led1(LED1);
+DigitalOut led2(LED2);
#define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console;
* it will have an impact on code-size and power consumption. */
#if NEED_CONSOLE_OUTPUT
-Serial pc(USBTX, USBRX);
+Serial pc(p12, p11);
#define DEBUG(...) { pc.printf(__VA_ARGS__); }
#else
#define DEBUG(...) /* nothing */
@@ -111,22 +112,24 @@
void periodicCallback(void)
{
led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */
-
+ led2 = !led2;
+ /*
if (ble.getGapState().connected) {
- /* Update the battery measurement */
+ // Update the battery measurement
batteryLevel--;
if (batteryLevel == 1) {
batteryLevel = 100;
}
ble.updateCharacteristicValue(batteryPercentage.getValueAttribute().getHandle(), &batteryLevel, sizeof(batteryLevel));
- /* Update the temperature measurement */
+ Update the temperature measurement
temperature++;
if (temperature == 50) {
temperature = 10;
}
ble.updateCharacteristicValue(tempMeas.getValueAttribute().getHandle(), &temperature, sizeof(temperature));
}
+ */
}
int main(void)
