Open Tannoo opened 6 years ago
I tried swapping the clock pins with setClockPins
, but it did nothing. I'm likely doing something wrong.
Hi - I've not used this code in a while, but I think it should work if you have two Tick instances set to use separate pairs of pins.
Are you getting errors from the code or is it just not driving the second motor? You could try hooking up a couple of LEDs to the outputs to see if it's sending any pulses out. If it is sending pulses then I suppose its possible that the motor for the minute hand needs different pulse timings or more current.
How would I setup two instances?
Tick ticksec
Tick tickmin
?
Yeah, exactly - then in setup
you'll need to configure each one with the pins you're using, and the delay between ticks (1000 for one tick per second, and 60000 for one a minute)
ticksec.setup(tickSecPinA, tickSecPinB, 1000);
tickmin.setup(tickMinPinA, tickMinPinB, 60000);
and update each one in the main loop
ticksec.stepMillisecondDelta(dt);
tickmin.stepMillisecondDelta(dt);
I like your library for this. It works fine for one motor.
I have interfaced with a $20 atomic clock from Wal-Mart to give me control of the minute hand also. So, there are two of these motors in there.
I have them working with my own timings, but I am trying to use your library, as it would make my code cleaner.
I hope that the library doesn't have to get re-written, because it is nice as it is.