juan carlos cortes parra
/
control
jkjk
Revision 1:b050c775bc27, committed 2020-10-26
- Comitter:
- juankafil1
- Date:
- Mon Oct 26 02:55:52 2020 +0000
- Parent:
- 0:8b3f25c2e7ed
- Commit message:
- nnn;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Oct 25 06:45:23 2020 +0000 +++ b/main.cpp Mon Oct 26 02:55:52 2020 +0000 @@ -5,9 +5,10 @@ DigitalIn valor(PTC5); DigitalOut right(PTC7); DigitalOut left(PTC0); -int rea; +int rea,ns; string cadena; using namespace std; + //using namespace boost; float h; @@ -15,32 +16,59 @@ while(1){ if(pc.readable()){ cadena=pc.getc(); + } + if (cadena=="1"){ + + h=0.1; + pc.printf("helllo %.2f",h); + } + if (cadena=="2"){ + h=0.2; + pc.printf("helllo %.2f",h); + } + if (cadena=="3"){ + h=0.3; + pc.printf("helllo %.2f",h); + } + if (cadena=="4"){ + h=0.4; + pc.printf("helllo %.2f",h); + } + if (cadena=="5"){ + h=0.5; + pc.printf("helllo %.2f",h); + } + if (cadena=="6"){ + h=0.6; + pc.printf("helllo %.2f",h); + } + if (cadena=="7"){ + h=0.7; + pc.printf("helllo %.2f",h); + } + if (cadena=="8"){ + h=0.8; + pc.printf("helllo %.2f",h); + } + if (cadena=="9"){ + h=0.9; + pc.printf("helllo %.2f",h); + } + if (cadena=="10"){ + h=1; + pc.printf("helllo %.2f",h); + } + + + + //h=rea-50000; // pc.printf("%s",); // std::string Convert(float rea); //cadena=float.toString("%f",rea); - pc.printf(cadena); + //pc.printf("%s",cadena); } - /* if(rea=='1'){ - pc.printf("hola perras"); - right=1; - - // wait(1); - }else{ - pc.printf("esperando"); - right=0; - //wait(1); - // led=0; - - } - if(rea=='2'){ - left=1; - //wait(1); - }else{ - left=0; - //wait(1);*/ - } - } + +} + - -