Go Down

Topic: Simple clock (Read 1 time) previous topic - next topic


I want to eventually make a clock of some sort. Right now I simply want to understand how to keep time(I know that it would need to be set at startup but right now I'm not even worried about that). The examples in the Time Library all return errors for me like "'time_t' does not name a type" among many others. I was hoping for some help on this or an example of the most very basic way to keep accurate time on the arduino uno.



I was hoping for some help on this or an example of the most very basic way to keep accurate time on the arduino uno.

The most accurate way to keep time is to use an external RTC (real time clock). They are pretty cheap, and more accurate than the crystal or resonator on the Arduino.

If you need help with a sketch, you need to be a bit more specific about which sketch is giving you trouble. Post the code, or a link to it.
The art of getting good answers lies in asking good questions.


Well, all I really am looking for is the most basic, form of time keeping that can be programmed.


How about a simple count up software timer then that runs off of millis() or micros()?
Two buttons that you push/debounce to set the time, then free runs after that?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Try using the DS1307 Chip.

It might be easier


You can need a real time clock. All you have to do is to first call a bunch of functions, like RTC.settime(), to set up the clock, then anytime you want the time, you do something like RTC.gettime(). I don't think it's that difficult.

I have some sample codes:
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


Check out this Instructable

Freelance engineer, consultant, contractor. Graduated from UW in 2013.


Thanks guys, Ill look into RTC's.

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