Go Down

Topic: Clock with Arduino (Read 9766 times) previous topic - next topic


Feb 09, 2010, 04:29 pm Last Edit: Feb 09, 2010, 04:30 pm by mem Reason: 1
are you using 0018?

version 0017 disabled interrupts in delayMicroseconds and the LCD library does use this function.

Sounds like that may be the cause of you problem. Try it with 0018 if you are not yet using that.


I think I've read that the LCD library disables and re-enables interrupts. Maybe that's why millis is not keeping an accurate count.


Feb 09, 2010, 04:37 pm Last Edit: Feb 09, 2010, 04:39 pm by GrooveFlotilla Reason: 1
think I've read that the LCD library disables and re-enables interrupts

Can't think of any good reason why it should.  :o

Some delays, certainly, but the rest is just "digitalWrite"s
Per Arduino ad Astra


It was a side affect of the way delayMicroseconds works that has been fixed in arduino release 0018


mem - you sir win a cookie.  I upgraded to v18 and it is now running perfectly.  I'll have to try my original code with the rest of the software but the timer works fine now  :D


Good to hear you have it working.

btw, the code posted in reply #14 has the advantage that is uses fewer variables and uses less processing time (it does two additions each second rather than two divisions each time through the loop).

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131