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:4c9e631d23ca, committed 2021-05-22
- Comitter:
- Sigma884
- Date:
- Sat May 22 16:59:13 2021 +0000
- Commit message:
- first commit
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 Sat May 22 16:59:13 2021 +0000
@@ -0,0 +1,65 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX, 115200);
+
+DigitalOut pinA(p21);
+DigitalOut pinB(p22);
+DigitalOut pinC(p23);
+
+int main() {
+ while(1) {
+ if(pc.readable()){
+ char c = pc.getc();
+ pc.printf("Input: %c\r\n", c);
+ switch(c){
+ case '0':
+ pinA = 0;
+ pinB = 0;
+ pinC = 0;
+ break;
+
+ case '1':
+ pinA = 1;
+ pinB = 0;
+ pinC = 0;
+ break;
+
+ case '2':
+ pinA = 0;
+ pinB = 1;
+ pinC = 0;
+ break;
+
+ case '3':
+ pinA = 1;
+ pinB = 1;
+ pinC = 0;
+ break;
+
+ case '4':
+ pinA = 0;
+ pinB = 0;
+ pinC = 1;
+ break;
+
+ case '5':
+ pinA = 1;
+ pinB = 0;
+ pinC = 1;
+ break;
+
+ case '6':
+ pinA = 0;
+ pinB = 1;
+ pinC = 1;
+ break;
+
+ case '7':
+ pinA = 1;
+ pinB = 1;
+ pinC = 1;
+ break;
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat May 22 16:59:13 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file