Project: LCD clock with DS1307 RTC No Time.h

hi all,
i am having trouble to compile this project but keep getting the same fatal error:
i have read lot forums and checked all my folders are in places where i think they should be, my libraries are in the folder allocated by arduino when i installed the arduino ide. i have in the library folder - DS1307RTC , RTClib-master.and other libraries etc.i might be wrong can anyone pls help me? i know the arduino folder in the programs 86 holds all the files for arduino but the file allocated is in my document folder. i have edited the "86 " lists shotened. how should my folders be so that its correct for arduino

Arduino: 1.6.6 (Windows 7), Board: “Arduino/Genuino Uno”

“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “-IC:\Users\John\Documents\Arduino\libraries\DS1307RTC” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire” “-IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src” “C:\Users\John\AppData\Local\Temp\build899540e1426fa8ef211d496aba16ac24.tmp\sketch\sketch_nov29a.ino.cpp”

In file included from C:\Users\John\Documents\Arduino\sketch_nov29a\sketch_nov29a.ino:11:0:

C:\Users\John\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:9:18: fatal error: Time.h: No such file or directory

#include <Time.h>


compilation terminated.

Using library DS1307RTC at version 1.4 in folder: C:\Users\John\Documents\Arduino\libraries\DS1307RTC
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Using library LiquidCrystal at version 1.0.4 in folder: C:\Program Files (x86)\Arduino\libraries\LiquidCrystal
exit status 1
Error compiling.

#include <LiquidCrystal.h>
#include <DS1307RTC.h>
#include <Wire.h>
#include <time.h>

Libraries that you download and don't come as part of the core should go in your sketch folder (where sketches get saved) in a folder called libraries.

You probably need to download the Time library separately. It doesn't come with the RTC libs.

how should my folders be so that its correct for arduino

Check this out → Installing Additional Arduino Libraries.


The error occurred because DS1307RTC.h wanted to include <Time.h> on line 9 and that file couldn’t be found.

I know Windows is pretty brain dead and usually doesn’t care about the case (upper or lower) of characters in filenames but the actual file is “Time.h” and not “time.h” as used in the code shown which I assume is from the sketch.

It could also be that the code in the IDE that scans and looks for library header files doesn’t ignore case the way Windows does so the library isn’t found because of the misspelling of the header file name in the sketch.

Also, if the library is not installed in the proper place or the IDE was not restarted after it was manually installed it won’t be located.

Either way, you should fix the sketch code to include header by its proper name rather than depend on Windows ignoring case, since case really does matter.

— bill

hi all, I've read all the forum pages i think, and followed the where to install and put the arduino libraries etc, i've tried ( time.h Time.h ) i even tried the sample sketches ,they too dont compile. I always get the same error message. Can i pls give the link to where i got this project, and some can just try it.

txs all

Can i pls give the link to where i got this project, and some can just try it.

The code posted on that website compiles fine for me with 1.6.6.

It is very clear that you do not have the time library correctly installed on your computer. You have received that advice from several commenters now.

What is the path to where you have the library, and what is inside the library folder at that location?

How to install libraries is in the instructions pointed out.

You can use the IDE to install the library (recommended) or you can install it manually.
If you install it manually it must be installed/placed where the IDE is looks for a library.
If you are installing it manually in your {sketchbook}/libraries area,
you must make sure that the IDE is looking where you placed it.
i.e. where is {sketchbook}
You can see that by bringing up the IDE and clicking on:
(control key plus comma)

The path for {sketchbook} will be right at the top of that dialog box
in the box labled: Sketchbook location:

hi im sorry but i have reinstalled the ide and let the ide do all the library updates which all go to my sketch book folder, dunno but i must be a really big ass cause the error still same, even tried moving libraries around then ide says its folder is not at the right place and wants to create a new.

any idea to to try look for another time.h.point of giving up sorry guys

hi error file included

The first error message indicates you are using 1.6.6. I don't see the latest error message you say you posted.

Did you use the "library manager" found at Sketch>Include Library>Manage Libraries to install Time by Michael Margolis v1.5.0? You may have had to click on "more info" to bring up an install button if it was not installed.

Did you close and restart the IDE? Does the library now show as installed in the Library Manager? What is the path on your computer to this file? It may be in a folder called arduino_140499 in your sketch book libraries folder? You can rename that folder Time if you wish. Do the Time Library examples show up in your ide? Do they compile?

im so sorry for some reason it attachment did not get in.

i see someone has come back, ill return after i see what is written,

ArduinoDS1307 Time.doc (30 KB)

What sketch are you using? If the Time library is properly installed, then the Time library and its examples will show up when you clock on: [File]->[Examples]

--- bill

Hi all, thank you for all the help,found time.h in library manager let it install,bang all ok. THANK you very much.

I have read a lot of forum entries on Time.h. I have used the function for “Library Manager” to add DS1307RTC.h library. But searching has not turned up the Time.h library that is required by DS1307RTC.h

Where can I find it???

Here is my sketch and error.
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include <DS1307RTC.h>
#include <Time.h> //same error with or without this statement

Error received
C:\Users\Randy\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:9:18: fatal error: Time.h: No such file or directory
#include <Time.h>

compilation terminated.


What version of the IDE are you using?

What did you find with the "library manager" found at Sketch>Include Library>Manage Libraries?

"Time" is not with the DS1307, but you have to scroll quite a ways down to find it between "ThingSpeak" and "TimeAlarms".

Thanks for your help, I did find it. I assumed it wasn't there because I entered the name "Time.h" in the filter slot which resulted in zero files found.

The example program compiles without error. Great. Now to connect the DS1307 to my Mega 2560. Again, I have a large collection of references but nothing on assigning the SDA and SCL pins? I guess the DS1307RTC.h file does that for the user. It would be nice if the library example Sket would tell you what pins go where.

Thanks agian

I'd recommend keeping this diagram handy.

It shows where all the pins are, including i2c pins. Just hook up your RTC power and ground pins and then SCL and SDA to the mega SCL and SDA pins and you will be good to go.

--- bill