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 nRF51822_SimpleControls by
Revision 10:eb100af346bf, committed 2016-12-16
- Comitter:
- MarkSPA
- Date:
- Fri Dec 16 17:02:34 2016 +0000
- Parent:
- 9:02ac9f6bb320
- Child:
- 11:45f76d2b5b8c
- Commit message:
- Start of accepting a dig switch on P09
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Dec 16 00:13:52 2016 +0000 +++ b/main.cpp Fri Dec 16 17:02:34 2016 +0000 @@ -32,7 +32,7 @@ #define DIGITAL_OUT_PIN P0_17 //D7 #define BOARD_LED P0_19 // -#define DIGITAL_IN_PIN P0_5 //A4 +#define DIGITAL_IN_PIN P0_9 //P0_5 //A4 #define PWM_PIN P0_16 //D6 #define SERVO_PIN P0_14 //D10 #define ANALOG_IN_PIN P0_6 //A5 @@ -180,7 +180,11 @@ // If digital in changes, report the state if (BUTTON != old_state) { old_state = BUTTON; - + if (LEDS_ON_FLAG) + LEDS_ON_FLAG = 0; + else + LEDS_ON_FLAG = 1; + if (BUTTON == 1) { buf[0] = (0x0A); buf[1] = (0x01);