![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rohan-Code to measure the tilt of the ADXL355 using COG-AD4050.
Dependencies: include ADXL355 ttmath
Revision 3:6af4defb733f, committed 2019-10-08
- Comitter:
- RGurav
- Date:
- Tue Oct 08 13:55:10 2019 +0000
- Parent:
- 2:13377441fbd8
- Commit message:
- ADXL355 + COG4050 = Tilt and vibration measurement
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 13377441fbd8 -r 6af4defb733f main.cpp --- a/main.cpp Fri Jun 14 10:56:53 2019 +0000 +++ b/main.cpp Tue Oct 08 13:55:10 2019 +0000 @@ -22,7 +22,7 @@ int main() { - pc.baud(9600); + pc.baud(115200); pc.printf("SPI ADXL355 and ADXL357 Demo\r\n"); pc.printf("GET device ID\r\n"); @@ -51,10 +51,10 @@ //pc.printf("Enter no of axis for angle calculation (1/2/3):\r\n"); //pc.scanf("%d",&axis); - axis = 2; + axis = 3; pc.printf("||x_accl||y_accl||z_accl||x_tilt||y_tilt||z_tilt||\r\n"); - wait(1); + //wait(1); //Device ID display pc.printf("AD id = %x MEMS id = %x device=%x revision=%x \r\n", ad, mems, device, rev); @@ -96,8 +96,8 @@ if (axis==3) { - pc.printf("||%0.2f||%0.2f||%0.2f||%0.2f||%0.2f||%0.2f|| \r\n" , x, y, z, tilt_x, tilt_y, tilt_z); - wait(1.0); + pc.printf("||%0.2f||%0.2f||%0.2f|| \r\n" , x, y, z); + //wait(1.0); } if (axis == 4)