I would love to see support for these simple but powerful motor drivers.
I can drive them right now, but its a bit hacky, since i need to initialize 2 motors for each direction, since this doesnt use a direction pin, but instead use 2 pwm inputs, one for each direction.
Johnny-Five can support this motor driver. Try a configuration like this:
js
// substitute your pin numbers of course
motor = new five.Motor({
pins: {
pwm: 3,
dir: 12
},
invertPWM: true
});
It doesn't matter which motor input pin is pwm and which one is dir.
Let me know if this works for you and we can add an alias in Motor.SHIELD_CONFIGS for this model number for future genreations.
Seems to almost work, but not matter if i use .start() or .reverse() it runs i the same direction.
That sounds like the PWM value isn't being inverted when the direction changes.
Make sure the invertPWM: true bit is there and try .forward() and .reverse() instead of .start(). That last one just resumes the most recent "on" state regardless of direction.
Oh wait, my last comment was in response to a comment that is no longer here...
The part about forward and reverse still hold true though
Ahh seems like it was .,start() that was the issue, works perfect with forward and reverse.
Thanks a lot, that shaved of some code! :)
I'm going to re-open as a reminder to add an example for the DRV-8871