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:3a8eb881542c, committed 2018-11-15
- Comitter:
- Wizo
- Date:
- Thu Nov 15 18:07:03 2018 +0000
- Commit message:
- TINF_Echo
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 |
diff -r 000000000000 -r 3a8eb881542c main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 15 18:07:03 2018 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "string"
+
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut led1(LED1);
+
+// Globale Variable
+
+char in[100];
+bool flag = false;
+string eingabe;
+
+
+void receive() // callback
+{
+ //pc.putc(pc.getc()); // echo input back to terminal
+ while(pc.readable()) {
+ in [100] = pc.getc();
+ eingabe = in[100];
+ //ToDo: char in ein Feld ablegen und aus diesem einen String machen
+ }
+
+ flag = true;
+
+}
+
+
+int main()
+{
+
+ pc.attach(&receive);
+
+ pc.printf("Hello World!\n\r");
+ while(1) {
+
+ if(flag) {
+ //pc.putc(in); // ToDo: mit puts den String ausgeben
+ pc.puts(eingabe);
+
+ flag = false;
+ }
+ led1 = !led1;
+ wait(0.2);
+
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r 3a8eb881542c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 15 18:07:03 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file