Accel
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaAccel by
main.cpp
- Committer:
- tomoya123
- Date:
- 2016-12-09
- Revision:
- 0:d721efd58e4e
- Child:
- 1:63c3921c608c
File content as of revision 0:d721efd58e4e:
#include "mbed.h" #include "HeptaAccel.h" Serial pc(USBTX,USBRX); 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.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); } } }