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
fonction.cpp
00001 #include "mbed.h" 00002 #include "fonction.h" 00003 00004 int CRAN=0; 00005 float tour=0,rad=0, ms=0; 00006 void roule_motdroit (int vSensD, int vitesse) 00007 { 00008 if(vSensD==1){ 00009 PWMD.pulsewidth_us(100-vitesse); 00010 SensD=1;} 00011 else { 00012 PWMD.pulsewidth_us(vitesse); 00013 SensD=0;} 00014 } 00015 00016 void roule_motgauche (int vSensG, int vitesse) 00017 { 00018 if(vSensG==1) { 00019 PWMG.pulsewidth_us(100-vitesse); 00020 SensG=1;} 00021 else { 00022 PWMG.pulsewidth_us(vitesse); 00023 SensG=0;} 00024 } 00025 00026 void increment (void) 00027 { 00028 CRAN++; 00029 //printf("cran=%d\n\r",CRAN); 00030 } 00031 00032 void calcul_vit (void) 00033 { 00034 00035 tour=CRAN*1.1; //En cm/seconde 00036 ms=tour/100; // en m/s 00037 rad=tour*2*3.14/12; //Les 60 se simplifient pour =>> rad/seconde 00038 00039 printf("rad/s =%g m/s=%g\n\r",rad,ms); 00040 CRAN=0; 00041 }
Generated on Tue Jul 12 2022 13:34:15 by
1.7.2