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.
MainEvr.cpp.orig
- Committer:
- ThierryLeonard
- Date:
- 2017-09-05
- Revision:
- 8:5124be43c963
File content as of revision 8:5124be43c963:
#include "Accelerometre.h"
#include "Afficheur.h"
Serial pc(USBTX, USBRX);
int main() {
Afficheur afficheur;
Accelerometre acc;
double angle = 0;
while(true){
acc.readxyzAngle(&angle);
pc.printf("angle is : %lf\r\n",angle);
char c1[10];
char c2[4];
sprintf(c1 , "%4f" , angle);
int virgule;
int j =0;
for(int i =0;i<4;i++){
if(c1[j] == '.'){
virgule = 1 <<j-1;
i--;
j++;
continue;
}
c2[i] = c1[j];
j++;
}
pc.printf("virg= %d",virgule);
afficheur.write(c2,4, virgule);
pc.printf("test");
wait(0.45);
}
}
