Accel
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaAccel by
Diff: hepta_sat/HeptaAccel.cpp
- Revision:
- 1:63c3921c608c
- Parent:
- 0:d721efd58e4e
--- a/hepta_sat/HeptaAccel.cpp Fri Dec 09 03:40:15 2016 +0000 +++ b/hepta_sat/HeptaAccel.cpp Tue Dec 13 07:51:40 2016 +0000 @@ -149,7 +149,7 @@ float az; accel.start(); accel.write(addr); - accel.write(0x2C); + accel.write(0x05); accel.start(); accel.write(addr|0x01); _zmsb = accel.read(0); @@ -167,6 +167,7 @@ acc -= UINT14_MAX; } az = acc/4096.0*9.81; + //printf("az=%f\r\n",az); return(az); } @@ -247,6 +248,7 @@ accel.start(); accel.write(addr|0x01); _xmsb = accel.read(0); + printf("xmsb=%d\r\n",_xmsb); accel.stop(); accel.start(); accel.write(addr); @@ -261,6 +263,7 @@ a_u16[1]=a1[1]; a_u16[2]=a2[0]; a_u16[3]=a2[1]; + printf("a_u16_0=%c",a_u16[0]); *dsize = 4; } @@ -299,6 +302,7 @@ accel.start(); accel.write(addr|0x01); _zmsb = accel.read(0); + printf("zmsb=%d\r\n",_zmsb); accel.stop(); accel.start(); accel.write(addr); @@ -306,6 +310,7 @@ accel.start(); accel.write(addr|0x01); _zlsb = accel.read(0); + printf("zlsb=%d\r\n",_zlsb); accel.stop(); sprintf( a1, "%02X", ((_zmsb)) & 0xFF); sprintf( a2, "%02X", ((_zlsb)) & 0xFF);