|Equation evaluates to zero when it shouldn't
|Page 1 of 1|
|Author:||binarydude [ Wed May 24, 2017 4:45 pm ]|
|Post subject:||Equation evaluates to zero when it shouldn't|
I have written a function to move a motor to a particular position proportionally using a potentiometer.
Here is the code:
The current issue is that motorPower is being evaluated to zero and thus is being set to the minimum motor power. How can I get it so that it doesn't evaluate to zero?
Any help is appreciated.
|Author:||binarydude [ Wed May 24, 2017 9:44 pm ]|
|Post subject:||Re: Equation evaluates to zero when it shouldn't|
I have determined a solution to this issue.
If I cast currentDistanceToTarget and distanceToTarget to floats, the equation evaluates correctly.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group