|
@@ -484,11 +484,12 @@ Atm_AccelStepper& Atm_AccelStepper::moveTo( long int stepAbs) {
|
|
}
|
|
}
|
|
|
|
|
|
Atm_AccelStepper& Atm_AccelStepper::movePercent( float percent) {
|
|
Atm_AccelStepper& Atm_AccelStepper::movePercent( float percent) {
|
|
-
|
|
|
|
- _targetStep = _currentStep + percent*_maxStep;
|
|
|
|
|
|
+ // Serial.println(percent/100.)
|
|
|
|
+
|
|
|
|
+ _targetStep = (float)_currentStep + percent/100.*float(_maxStep);
|
|
runMode = 0;
|
|
runMode = 0;
|
|
// _isHoming = 0;
|
|
// _isHoming = 0;
|
|
- //Serial.println(_targetStep);
|
|
|
|
|
|
+ Serial.println(_targetStep);
|
|
stepper->moveTo(_targetStep);
|
|
stepper->moveTo(_targetStep);
|
|
enable();
|
|
enable();
|
|
trigger( EVT_MOVE );
|
|
trigger( EVT_MOVE );
|
|
@@ -496,9 +497,8 @@ Atm_AccelStepper& Atm_AccelStepper::movePercent( float percent) {
|
|
}
|
|
}
|
|
|
|
|
|
Atm_AccelStepper& Atm_AccelStepper::moveToPercent( float percent) {
|
|
Atm_AccelStepper& Atm_AccelStepper::moveToPercent( float percent) {
|
|
-
|
|
|
|
- _targetStep = percent*_maxStep;
|
|
|
|
- // _isHoming = 0 ;
|
|
|
|
|
|
+ _targetStep = (float) percent/100*float(_maxStep) ;
|
|
|
|
+ // _isHoming = 0
|
|
runMode = 0;
|
|
runMode = 0;
|
|
stepper->moveTo(_targetStep);
|
|
stepper->moveTo(_targetStep);
|
|
enable();
|
|
enable();
|