Use int64 in place of the int32
This commit is contained in:
parent
0c9d3ba658
commit
9552d738c2
|
@ -61,7 +61,7 @@ void IteadDualStepperShield::_both () {
|
||||||
delayMicroseconds(_usStepA);
|
delayMicroseconds(_usStepA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void IteadDualStepperShield::step (uint8_t motor, uint16_t steps, uint8_t dir) {
|
void IteadDualStepperShield::step (uint8_t motor, uint64_t steps, uint8_t dir) {
|
||||||
uint8_t stepPin = motor == 0 ? _stepA : _stepB;
|
uint8_t stepPin = motor == 0 ? _stepA : _stepB;
|
||||||
setDir(motor, dir);
|
setDir(motor, dir);
|
||||||
for (int i = 0; i < steps; i++) {
|
for (int i = 0; i < steps; i++) {
|
||||||
|
@ -74,7 +74,7 @@ void IteadDualStepperShield::onestep (uint8_t motor, uint8_t dir) {
|
||||||
_single(stepPin);
|
_single(stepPin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IteadDualStepperShield::stepBoth (uint16_t steps) {
|
void IteadDualStepperShield::stepBoth (uint64_t steps) {
|
||||||
for (int i = 0; i < steps; i++) {
|
for (int i = 0; i < steps; i++) {
|
||||||
_both();
|
_both();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef IteadDualStepperShield_h
|
#ifndef IteadDualStepperShield_h
|
||||||
#define IteadDualStepperShield_h
|
#define IteadDualStepperShield_h
|
||||||
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
class IteadDualStepperShield {
|
class IteadDualStepperShield {
|
||||||
|
@ -32,8 +31,8 @@ class IteadDualStepperShield {
|
||||||
void setSpeed(uint8_t motor, uint16_t speed);
|
void setSpeed(uint8_t motor, uint16_t speed);
|
||||||
|
|
||||||
//full
|
//full
|
||||||
void step(uint8_t motor, uint16_t steps, uint8_t dir);
|
void step(uint8_t motor, uint64_t steps, uint8_t dir);
|
||||||
void stepBoth(uint16_t steps);
|
void stepBoth(uint64_t steps);
|
||||||
void onestep(uint8_t motor, uint8_t dir);
|
void onestep(uint8_t motor, uint8_t dir);
|
||||||
|
|
||||||
void release();
|
void release();
|
||||||
|
|
Loading…
Reference in New Issue