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
- Committer:
- ThierryLeonard
- Date:
- 2017-09-06
- Revision:
- 10:2836530d9a5e
- Parent:
- 9:b9ac1d914762
File content as of revision 10:2836530d9a5e:
#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); } }