I’m trying to control direction and speed of a small DC motor with a single digital IO pin and a single PWM pin.
I’m interfacing to the motor via a L9110S.
My theory is to use pin 4 (on a Micro) for direction and pin 5 (PWM) for speed.
When pin 4 is LOW I set the speed using various values on the PWM pin between 0 and 255
When pin 5 is HIGH I set the speed using (255 minus the speed value)
However, this does not seem to be working - the motor only travels in one direction (forget which) regardless of what pin 4 is set to.
Am I doing something wrong with the PWM ?
Maybe the L9110S doesn’t like PWM ?
Any thoughts, much appreciated.