I can't even begin to express the level of frustration I'm feeling right now with regard to something so very, very simple.
I'm trying to control a quartz clock mechanism with an arduino. I've watched video after video and all I seem to be doing is destroying mechanism after mechanism - except I have no idea if I'm breaking them, they just don't work and this process seems to be one way.
This is the clearest video I've found of the process of converting:
I just can't get anything to happen regardless of what I do.
Code I'm testing with is
int clockA = 7; // Set these to the pin numbers you have attached the clock wires
int clockB = 8; // to. Order is not important.
int tickPin = clockA; // This keeps track of which clock pin should be fired next.
// Initialize the IO ports
void setup()
{
pinMode(clockA, OUTPUT);
pinMode(clockB, OUTPUT);
digitalWrite(clockA, LOW);
digitalWrite(clockB, LOW);
Serial.begin(9600);
}
// Move the second hand forward one position (one second on the clock face).
void doTick() {
// Energize the electromagnet in the correct direction.
digitalWrite(tickPin, HIGH);
delay(10);
digitalWrite(tickPin, LOW);
// Switch the direction so it will fire in the opposite way next time.
if (tickPin == clockA)
{
tickPin = clockB;
} else {
tickPin = clockA;
}
}
// Main loop
void loop()
{
unsigned long startTime = millis();
unsigned long temp;
// Pretend to be a regular clock, and tick once a second.
while (true)
{
startTime += 1000;
// Wait until a second has passed. Note that this will do ugly things when millis()
// runs over, so we only have about 9 hours before this version will stop working.
while (startTime - millis() > 0) {}
doTick();
}
}
Can anyone offer anything



