Go Down

Topic: Time Library added to Playground (Read 39 times) previous topic - next topic

mem

Hi  ccfreak2k, I would be interested to hear the responses to your question. Why not start a new thread for discussion of your library when you have had a chance to get it tested and place a link here so people can find it..

I would be happy to include a DS3231 library with the Time library distribution  if this is something people want.

SeanC

I am trying to use this library, and can't see to get past what appears to be a simple error, using Ard0021 on OS X.

I have unpacked the zip, and so now have

Sketches
 - Libraries
      - Time (dl from playground)
      - TinyGPS (was there already)
      - NewSoftSerial (was there already)

Sketches in the Sketches folder seem to have no problem using header files from the TinyGPS or NewSoftSerial folders, but whenever I try to include Time.h, I get this:

TimeGPS.cpp:7:18: error: Time.h: No such file or directory

The include line looks like this:

#include <Time.h>

I've reviewed the Arduino instructions several times, and can't see what I'm doing wrong.  Time.H is shown in the list of available libraries when I select Sketch - Import Library (along with NewSoftSerial and TinyGPS).

I copied the TimeGPS example to the Sketches folder, and it can find the TinyGPS and NewSoftSerial.h no problem (they turn orange in the editor), but can't find the Time.h, even though it's in the same place.  Time.h doesn't turn black.

I must be doing something wrong - can anyone point me in the right direction, please?

mem

SeanC, did you try to open  the TimeGPS example sketch by navigating:  File->Examples->Time->Examples->TimeGps

If you can open and correctly compile that sketch,  click  File->Save As to your sketchbook directory and after the IDE copies the sketch, see it that also compiles okay.

SeanC

Thanks for your reply!  I unpacked the archive again, opened the

TimeGPS example sketch with :  File->Examples->Time->Examples->TimeGps

and it still fails the same way.  Interestingly, I can see it's going to fail, because the Time.h in the sample code is all black in the editor, whereas the two found libraries, TinyGPS and NewSoftSerial are orange.

#include <Time.h>
#include <TinyGPS.h>    
#include <NewSoftSerial.h>  

I closed and re-opened the arduino ide, and still can see Time in the Sketch-Import Libraries menu.

Any help would be appreciated!

mem

#134
Nov 07, 2010, 07:44 pm Last Edit: Nov 07, 2010, 07:44 pm by mem Reason: 1
I think the coloring is a red herring. Arduino libraries use a syntax coloring file to enble the IDE to highlight keywords. Tinygps and NewSoftSerial are Class names that are used within the sketch so they are in the Syntax coloring file. The Time class name is not explicitly used in a sketch so its in the syntax coloring file and is not highlighted.

Something else is causing your problem. Are you quite sure that the Time library folder location is  correct and that all the files are there?

I don't use OS X, perhap someone that does can check if they have any problems compiling the Time library example sketches.


Go Up