We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8645697 commit f1429f4Copy full SHA for f1429f4
1 file changed
C++/Library/src/ServoProject.cpp
@@ -664,11 +664,11 @@ void DCServoCommunicator::run()
664
}
665
else
666
{
667
- long int upscaledPos = static_cast<unsigned long int>(intReadBuffer[3]);
+ long int upscaledPos = static_cast<unsigned short int>(intReadBuffer[3]);
668
upscaledPos += (static_cast<long int>(charReadBuffer[9]) << 16);
669
- if (upscaledPos >= (2 << 23))
+ if (upscaledPos >= (1 << 23))
670
671
- upscaledPos -= (2 << 24);
+ upscaledPos -= (1 << 24);
672
673
674
long int encPosWithBacklashComp = intReadBuffer[10] + static_cast<long int>(intReadBuffer[11]);
0 commit comments