case3
Dependencies: mbed SeeedShieldBot BluetoothSerial
Revision 0:38220a94a194, committed 2021-09-15
- Comitter:
- roman360025
- Date:
- Wed Sep 15 15:07:22 2021 +0000
- Commit message:
- case3
Changed in this revision
diff -r 000000000000 -r 38220a94a194 BluetoothSerial.lib --- /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
diff -r 000000000000 -r 38220a94a194 SeeedShieldBot.lib --- /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
diff -r 000000000000 -r 38220a94a194 main.cpp --- /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
diff -r 000000000000 -r 38220a94a194 mbed.bld --- /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