case3

Dependencies:   mbed SeeedShieldBot BluetoothSerial

Files at this revision

API Documentation at this revision

Comitter:
roman360025
Date:
Wed Sep 15 15:07:22 2021 +0000
Commit message:
case3

Changed in this revision

BluetoothSerial.lib Show annotated file Show diff for this revision Revisions of this file
SeeedShieldBot.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BluetoothSerial.lib	Wed Sep 15 15:07:22 2021 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yihui/code/BluetoothSerial/#f56002898ee8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SeeedShieldBot.lib	Wed Sep 15 15:07:22 2021 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/components/code/SeeedShieldBot/#9fd1722259a1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 15 15:07:22 2021 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+ 
+RawSerial  pc(USBTX, USBRX);
+RawSerial  dev(D8, D2);
+DigitalOut led1(LED1);
+ 
+void dev_recv()
+{
+    led1 = !led1;
+    while(dev.readable()) {
+        pc.putc(dev.getc());
+    }
+}
+ 
+void pc_recv()
+{
+    while(pc.readable()) {
+        dev.putc(pc.getc());
+    }
+}
+ 
+int main()
+{
+    pc.baud(115200);
+    dev.baud(115200);
+ 
+    pc.attach(&pc_recv, Serial::RxIrq);
+    dev.attach(&dev_recv, Serial::RxIrq);
+ 
+    while(1) {
+        sleep();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 15 15:07:22 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file