-
-
Notifications
You must be signed in to change notification settings - Fork 7k
RobotControl::motorsWritePct bug #1478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
100.0, or you are teuncating the decimal part. Also some parentesis should
|
The function input parameters (speedLeftPct and speedRightPct) are both integer type, with presumed value [0-100]. I don't believe the original implementer wanted floating point arithmetic, for efficiency's sake. So there should be no decimal in the constant (i.e., the constant should be 100, not 100. ) and my original patch is correct. I leave it up to the integrator to decide if quotes really help, given the standard C precedence rules. I wouldn't re-order the expression due to loss of precision. Caveat: this seems to be an undocumented function (not listed in the arduino.cc reference page for Robot library). So my assumptions about the correct function behavior may be incorrect. |
…posite, updated turning algorithm
Fixed in 1.5.6 with X-Y@53adddc |
* 'master' of https://github.com/arduino/Arduino: Corrected repeated 'less' in checkName's message Removed unused code, fixed indentation. Local (user installed) libraries have priority over system libraries Update README.md Added license for Client, IPAddressm and Server (master branch) Added license for Arduino.h, binary.h and main.cpp (master branch) Added some friendly messages for Arduino Robot include errors on old sketches Revert "Changed pins definition in variants from constants to #defines." Fixed issue arduino#1478, arduino#1599, arduino#1709, motors being opposite, updated turning algorithm If 2 libs have same .h file, use the lib with same dir name WiFi Shield examples: added the firmware version check Updated Listfiles SD example Rename README.mkdn to README.md Update and rename readme.txt to README.mkdn Update readme.txt Minor changes to Communication Examples
Version 1.0.5 of the IDE. RobotControl::motorsWritePct() has an arithmetic error when computing the left/right motor speed.
Both the left/right values need to be divided by 100.
Old code:
I believe it should read:
The text was updated successfully, but these errors were encountered: