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:092cef4ad794, committed 2020-05-04
- Comitter:
- dg81
- Date:
- Mon May 04 12:48:13 2020 +0000
- Commit message:
- lire sur liaison serie;
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 Mon May 04 12:48:13 2020 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "string.h"
+Serial pc(USBTX, USBRX,19200); // tx, rx sur les broches associées au bus USB
+int err;
+char command[9];
+int main(void)
+{
+ while(1)
+ {
+ if (pc.readable()){
+
+ err=pc.scanf("%s",command);
+ printf("la commande est : %s \n",command);
+
+ if(strcmp(command,"marche")==0) {
+ printf("en avant!!!\n");
+ }
+
+ if (strcmp(command,"arret")==0){
+ printf("STOP!!!");
+ }
+ }
+
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 04 12:48:13 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file