From 4fe2261a998bf36b00df93fac0986158b764bb0a Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 27 Mar 2014 19:28:57 -0400 Subject: [PATCH] Tried to clean up potToDegrees. Untested. --- MyRobot.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MyRobot.cpp b/MyRobot.cpp index 878a0d9..76cec1f 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -165,13 +165,11 @@ public: } //}}} //potToDegrees{{{ + //TODO: Test this! float potToDegrees(float a) { float max = -.0003948; float min = 5.0245547; - float b = a - max; - min = min - max; // ~5.0027 - max = max - max; //=0 - return 300 - ((b + max) * (300 / min)); + return 300-(a*(300/(min-max))); } //}}} //cvt{{{