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
Revision 0:e39ab7c7639b, committed 2020-05-14
- Comitter:
- LucaNeri
- Date:
- Thu May 14 23:01:49 2020 +0000
- Commit message:
- Test
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 May 14 23:01:49 2020 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+
+DigitalOut myled_1(LED1);
+DigitalOut myled_2(LED2);
+Serial pc(USBTX,USBRX, 230400);
+Serial ZB(p28,p27, 230400);
+
+
+int main() {
+ myled_1 = 1;
+ myled_2 = 1;
+ ZB.printf("I'm R1!\n");
+
+ while(1)
+ {
+ if (ZB.readable()){
+
+ char command = ZB.getc();
+
+ pc.printf("%c\n",command);
+
+ //ZB.printf("%c\n", command);
+
+ switch(command) {
+ case '1':
+ ZB.putc(1);
+ if (myled_1 == 0)
+ myled_1 = 1;
+ else if (myled_1 == 1)
+ myled_1 = 0;
+ break;
+// case '2':
+// if (myled_2 == 0)
+// myled_2 = 1;
+// else if (myled_2 == 1)
+// myled_2 = 0;
+// break;
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 14 23:01:49 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file