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
Diff: main.cpp
- Revision:
- 0:092cef4ad794
--- /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!!!"); + } + } + + } +} +