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.
Revision 0:4c2a5ae75108, committed 2015-11-26
- Comitter:
- 4180_1
- Date:
- Thu Nov 26 01:48:35 2015 +0000
- Commit message:
- ver 1.0
Changed in this revision
| 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/main.cpp Thu Nov 26 01:48:35 2015 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+
+RawSerial pc(USBTX, USBRX);
+RawSerial dev(p13,p14);
+DigitalOut led1(LED1);
+DigitalOut led4(LED4);
+
+void dev_recv()
+{
+ led1 = !led1;
+ while(dev.readable()) {
+ pc.putc(dev.getc());
+ }
+}
+
+void pc_recv()
+{
+ led4 = !led4;
+ char x;
+ while(pc.readable()) {
+ x=pc.getc();
+ dev.putc(x);
+ pc.putc(x); //echo back so that you can see what you are typing!
+ }
+}
+
+int main()
+{
+ pc.baud(9600);
+ dev.baud(9600);
+
+ pc.attach(&pc_recv, Serial::RxIrq);
+ dev.attach(&dev_recv, Serial::RxIrq);
+
+ while(1) {
+ sleep();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 26 01:48:35 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file