![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SimpleControls works with the BLEController iOS/Android App. The mbed's pin can acts as DIGITAL_IN, DIGITAL_OUT, PWM, SERVO, ANALOG_IN. The sketch is to show you how to control the pin as one of the abilities. Note that not every pin can own all of the abilities.
Dependencies: BLE_API mbed nRF51822
Fork of nRF51822_SimpleControls by
Diff: main.cpp
- Revision:
- 4:df5f8c413d32
- Parent:
- 3:823f105078c7
diff -r 823f105078c7 -r df5f8c413d32 main.cpp --- a/main.cpp Thu Jan 07 02:49:37 2016 +0000 +++ b/main.cpp Thu Jan 28 01:24:09 2016 +0000 @@ -28,11 +28,11 @@ #define TXRX_BUF_LEN 20 -#define DIGITAL_OUT_PIN P0_17 //D7 -#define DIGITAL_IN_PIN P0_5 //A4 -#define PWM_PIN P0_16 //D6 -#define SERVO_PIN P0_14 //D10 -#define ANALOG_IN_PIN P0_6 //A5 +#define DIGITAL_OUT_PIN P0_20 //LED_R +#define DIGITAL_IN_PIN P0_28 //key1 +#define PWM_PIN P0_22 //Buzzer +#define SERVO_PIN P0_8 //GPIO +#define ANALOG_IN_PIN P0_1 //connect to power BLE ble; @@ -42,7 +42,7 @@ AnalogIn ANALOG(ANALOG_IN_PIN); Servo MYSERVO(SERVO_PIN); -Serial pc(USBTX, USBRX); +Serial pc(P0_23, P0_25); static uint8_t analog_enabled = 0; static uint8_t old_state = 0;