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: C12832 MMA7660 mbed
main.cpp
- Committer:
- Bleiz038
- Date:
- 2018-11-16
- Revision:
- 0:434201e2c3c2
File content as of revision 0:434201e2c3c2:
#include "mbed.h"
#include "MMA7660.h"
#include "C12832.h"
LocalFileSystem local("local");
MMA7660 MMA(p28, p27);
int W=0;
DigitalOut Y(LED1);
float x = 0;
float y = 0;
float z = 0;
int main() {
FILE *fp = fopen("local/mesures.csv","w");
if (MMA.testConnection())
for (W=0;W<100;W=W++){
x= MMA.x();
y= MMA.y();
z= MMA.z();
fprintf(fp,"%d;%f;%f;%f;\n",W,x,y,z);
Y=1;
wait(0.1);
Y=0;
}
fclose(fp);
}