Merge pull request #93 from TimEvWw/master

[Scaled encoder]²
pull/96/head
Tim Evers 2017-08-18 19:59:25 +02:00 committed by GitHub
commit 2464b7a3f0
1 changed files with 24 additions and 24 deletions

View File

@ -16,11 +16,11 @@ void StepperControl::reportEncoders()
{
Serial.print(COMM_REPORT_ENCODER_SCALED);
Serial.print(" X");
Serial.print(encoderX.currentPosition());
Serial.print((float)encoderX.currentPosition() / (float)stepsPerMm[0]);
Serial.print(" Y");
Serial.print(encoderY.currentPosition());
Serial.print((float)encoderY.currentPosition() / (float)stepsPerMm[1]);
Serial.print(" Z");
Serial.print(encoderZ.currentPosition());
Serial.print((float)encoderZ.currentPosition() / (float)stepsPerMm[2]);
CurrentState::getInstance()->printQAndNewLine();
Serial.print(COMM_REPORT_ENCODER_RAW);
@ -1388,32 +1388,32 @@ bool StepperControl::endStopsReached()
void StepperControl::storePosition()
{
// if (motorConsEncoderEnabled[0])
// {
// CurrentState::getInstance()->setX(encoderX.currentPosition());
// }
// else
// {
if (motorConsEncoderEnabled[0])
{
CurrentState::getInstance()->setX(encoderX.currentPosition());
}
else
{
CurrentState::getInstance()->setX(axisX.currentPosition());
// }
}
// if (motorConsEncoderEnabled[1])
// {
// CurrentState::getInstance()->setY(encoderY.currentPosition());
// }
// else
// {
if (motorConsEncoderEnabled[1])
{
CurrentState::getInstance()->setY(encoderY.currentPosition());
}
else
{
CurrentState::getInstance()->setY(axisY.currentPosition());
// }
}
// if (motorConsEncoderEnabled[2])
// {
// CurrentState::getInstance()->setZ(encoderZ.currentPosition());
// }
// else
// {
if (motorConsEncoderEnabled[2])
{
CurrentState::getInstance()->setZ(encoderZ.currentPosition());
}
else
{
CurrentState::getInstance()->setZ(axisZ.currentPosition());
// }
}
}
void StepperControl::reportEndStops()