
Tell the arduino
Dependencies: BLE_API mbed nRF51822
Fork of CoolTourHat by
Revision 24:78ef9deab4bc, committed 2017-03-11
- Comitter:
- sevenmaster
- Date:
- Sat Mar 11 19:40:33 2017 +0000
- Parent:
- 23:ba3d7a28096d
- Commit message:
- output pin for arduino
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Mar 05 06:00:31 2017 +0000 +++ b/main.cpp Sat Mar 11 19:40:33 2017 +0000 @@ -7,6 +7,7 @@ BLE &ble = BLE::Instance(BLE::DEFAULT_INSTANCE); Serial pc(USBTX, USBRX); +DigitalOut alarmout(P0_15); //Output pin 0 if there is an alarm // Connect handle uint16_t peripheral_handle = GattAttribute::INVALID_HANDLE; uint16_t client_handle = GattAttribute::INVALID_HANDLE; @@ -44,10 +45,12 @@ /* * Restart advertising when phone app disconnects */ - void alarm() { pc.printf("ALARRRRM\r\n"); + //Inform the arduino + alarmout = 0; wait(0.1); + alarmout = 1; } void onAlarmWritten(const GattWriteCallbackParams *response) { alarm(); @@ -264,6 +267,7 @@ { /* initialize stuff */ + alarmout = 1; pc.printf("\n\r********* Starting Main Loop *********\n\r");