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: SDFileSystem_conMOD mbed-rtos mbed
Fork of f4_sd_imu_4 by
main.cpp
- Committer:
- rattokiller
- Date:
- 2018-01-21
- Revision:
- 11:3b5e035ffef9
- Parent:
- 9:7f0c1261e905
File content as of revision 11:3b5e035ffef9:
#include "mbed.h" #include "setting.h" #define f_campionamento 100 // se va male 50 #define debug DigitalIn mybutton(USER_BUTTON); Ticker accelerometro; Thread thread; Timer tempo; float temp; int n=0; void simula_dati(){ ax=n++ /100.0; ay=4.56; az=-4.358; //prelivevo dei dati fatto in tempo float t=tempo.read(); if((t-temp)>1.0/(2*f_campionamento))pc.printf("problema"); temp=t; invia_m(1000*ax+4000,1000*ay+4000,1000*az+4000,0,0,0); } int main() { init(); initFile(); //initAccellerometro(); aperturaFile(); tempo.reset(); tempo.start(); temp=0; accelerometro.attach(&raccoltaDati,1.0/f_campionamento); thread.start(callback(scrivi_m)); while(1){ Thread::wait(0.01); if (mybutton) { invia_m(65535,65535,65535,65535,65535,65535); Thread::wait(2); } } }