Dependencies:   BNO055_fusion_tom FastPWM mbed

Fork of NucleoCube1 by Will Church

Files at this revision

API Documentation at this revision

Comitter:
tomras12
Date:
Tue Apr 18 03:15:07 2017 +0000
Parent:
26:f2bb916262c9
Commit message:
Fixed hall sensor analog read

Changed in this revision

cube.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f2bb916262c9 -r c3ca97f1db60 cube.cpp
--- a/cube.cpp	Thu Apr 13 23:17:41 2017 +0000
+++ b/cube.cpp	Tue Apr 18 03:15:07 2017 +0000
@@ -39,7 +39,7 @@
 {
     // Converts and read the analog input value (value from 0.0 to 1.0):
     double wv = c->hall->read();
-    wv = (wv - 2.0) * 5000.0; // Scale the velocity to rad/s
+    wv = (wv - 1.65) * 5000.0 / 1.65; // Scale the velocity to rad/s
 
     double bt = (*(c->angle) - c->eqAngle);