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 RedBearLab

Files at this revision

API Documentation at this revision

Comitter:
helloqi
Date:
Tue Apr 12 03:05:04 2016 +0000
Parent:
3:823f105078c7
Commit message:
change pins for linknode

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 823f105078c7 -r 3445b1647be5 main.cpp
--- a/main.cpp	Thu Jan 07 02:49:37 2016 +0000
+++ b/main.cpp	Tue Apr 12 03:05:04 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  //D7
+#define DIGITAL_IN_PIN                   P0_29  //A4
+#define PWM_PIN                          P0_19  //D6
+#define SERVO_PIN                        P0_22  //D10
+#define ANALOG_IN_PIN                    P0_1   //A5
 
 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;