Accel
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaAccel by
Diff: main.cpp
- Revision:
- 1:63c3921c608c
- Parent:
- 0:d721efd58e4e
--- a/main.cpp Fri Dec 09 03:40:15 2016 +0000 +++ b/main.cpp Tue Dec 13 07:51:40 2016 +0000 @@ -5,19 +5,14 @@ HeptaAccel accel(p28,p27,0x38); int main(){ - pc.baud(9600); - float ax2,ay2,az2; - char ax[4],ay[4],az[4]; - int dsize; - while(1){ + pc.baud(9600); + float ax,ay,az; + while(1){ pc.printf("Accel Sensor Mode\r\n"); - for(int i=0;i<10;i++){ - accel.sensing_u16(ax,ay,az,&dsize); - accel.sensing(&ax2,&ay2,&az2); - pc.printf("%c%c%c%c %c%c%c%c %c%c%c%c %c%c%c%c\r\n",ax[0],ax[1],ax[2],ax[3],ay[0],ay[1],ay[2],ay[3], - az[0],az[1],az[2],az[3]); - pc.printf("%f %f %f\r\n",ax2,ay2,az2); - wait(1.0); - } - } + for(int i=0;i<10;i++){ + accel.sensing(&ax,&ay,&az); + pc.printf("%f %f %f\r\n",ax,ay,az); + wait(1.0); + } + } } \ No newline at end of file