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: mbed
Fork of mbed_serial_test by
Diff: main.cpp
- Revision:
- 0:47c7262c17ac
- Child:
- 1:5c5cd69a3cf8
diff -r 000000000000 -r 47c7262c17ac main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Sep 01 02:06:26 2015 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+Serial BLEmate(p9,p10); //tx,rx
+
+DigitalOut led1(LED1);
+
+
+void BLEmateready();
+
+int main() {
+ BLEmate.attach(&BLEmateready);
+ pc.printf("Something from mbed to PC\n\r");
+ while (1) {
+ led1 = !led1;
+ wait(0.5);
+ }
+}
+
+void BLEmateready() {
+ pc.printf("phone sends: ");
+ while ( BLEmate.readable() ) {
+ pc.putc(BLEmate.getc());
+ }
+ pc.printf("\n\r");
+}
\ No newline at end of file
