10A DC Motor Driver Arduino Shield direction
Posted: Mon Mar 16, 2015 3:52 am
on the sample code you use :
// Control the motor according to the speed value.
// Positive speed value = CW,
// Negative speed value = CCW.
if (iSpeed >= 0) {
analogWrite(pinPwm, iSpeed);
digitalWrite(pinDir, LOW);
}
else {
analogWrite(pinPwm, -iSpeed);
digitalWrite(pinDir, HIGH);
}
what does the direction pin controls? do I always wave to have positive pwm with low? what if I put -ispeed with low direction?
what does actually control the direction the pas/neg value of the PWM of the pinDir: LOW/HIGH?
// Control the motor according to the speed value.
// Positive speed value = CW,
// Negative speed value = CCW.
if (iSpeed >= 0) {
analogWrite(pinPwm, iSpeed);
digitalWrite(pinDir, LOW);
}
else {
analogWrite(pinPwm, -iSpeed);
digitalWrite(pinDir, HIGH);
}
what does the direction pin controls? do I always wave to have positive pwm with low? what if I put -ispeed with low direction?
what does actually control the direction the pas/neg value of the PWM of the pinDir: LOW/HIGH?