Rohan - COG4050 and ADXL355 Tilt sensing

Dependents:   COG4050_adxl355_tilt COG4050_adxl355_tilt COG4050_adxl355_tilt_4050

Fork of ADXL355 by Rohan Gurav

Files at this revision

API Documentation at this revision

Comitter:
RGurav
Date:
Tue Aug 21 13:25:06 2018 +0000
Parent:
0:1b8d65be0eef
Commit message:
COG4050 and ADXL355 Tilt sensing

Changed in this revision

ADXL355.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 1b8d65be0eef -r e80c97768af4 ADXL355.cpp
--- a/ADXL355.cpp	Wed Aug 15 11:51:45 2018 +0000
+++ b/ADXL355.cpp	Tue Aug 21 13:25:06 2018 +0000
@@ -237,9 +237,11 @@
     // Otherwise perform the 2's complement math on the value
     return float((~(data - 0x01)) & 0xfffff) * -1;
 }
-ADXL355::ADXL355_calibdata_t ADXL355::convert_2p(float angle[11][2], float meas[11][2]){
+ADXL355::ADXL355_calibdata_t ADXL355::convert_2p(float angle[11][2], float meas[11][2])
+{
     ADXL355_calibdata_t res;
-    for(int i=0; i<3; i++){ 
+    for(int i=0; i<3; i++)
+    { 
         res.S[i][i]= (angle[i][1]-angle[i][0])/(meas[i][1]-meas[i][0]);
         res.B[i][0]= (angle[i][0]*meas[i][1]-angle[i][1]*meas[i][0])/(meas[i][1]-meas[i][0]);
     }