Can't get RTClib to be recognized

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Can't get RTClib to be recognized

Postby petespaco » Sat May 12, 2012 7:35 am

New to Arduino. I have watched all the Jeremy Blum tutorials and read several of yours, and I have built and run several of the circuits. So far, all my code errors have been my own cockpit errors but this one is really frustrating.

I am trying to verify the SD card/Datalogger/RTC Fridge logger program (before I start to modify it for my own use). I keep getting errors telling me that the RTClib.h doesn't exist. I have read many, many forum entries regarding this problem and have tried the fixes suggested, but none of them work for me.

So, I have just copied the first three statements to their own file:

#include <SD.h>
#include <Wire.h>
#include "RTClib.h"

That's all there is to it. I still get the error:


sketch_may12a.cpp:3:20: error: RTClib.h: No such file or directory


Here's where my sketches are located:

C:\Users\ztpete\New My Documents\Arduino\arduino-1.0\sketchbook

Here's where my RTClib subdirectory is located:

C:\Users\ztpete\New My Documents\Arduino\arduino-1.0\libraries\RTClib

Within the subdirectory \RTClib are the following files, with file sizes, just to show they aren't empty:
keywords.txt 1Kb
RTClib.cpp 7Kb
RTClib.h 2Kb

I also tried changing the double quotes to <> as suggested by one forum entry.
(See below)
It appears that the double quotes tell the program to look for the library within
the sketchbook or within the subdirectory that has the same name as the sketch.
#include <SD.h>
#include <Wire.h>
#include <RTClib.h>

This form gives me the same result, which is:

sketch_may12a.cpp:3:20: error: RTClib.h: No such file or directory

An interesting thing (to me):

The "SD" and the "Wire" terms are highlighted in Orange. But the RTClib.h is
written in black characters when I use the <>, but in Blue when I use "". I don't know if this helps, but the ".h" in the first two terms is NOT highlighted (eg: they are in black), whereas the ".h" in the RTClib.h term IS highlighted in Blue when I use the double quotes.


The thing is, I don't even have an RTC shield yet. All I want from this program is a way to automatically make a new filename each time my program runs.

What am I doing wrong?

petespaco
petespaco
 
Posts: 21
Joined: Thu Apr 19, 2012 6:53 pm
Location: west central wisconsin

Re: Can't get RTClib to be recognized

Postby Stephanie » Sat May 12, 2012 7:56 am

I'm not familiar with Arduino on Windows so this may or may not help, but in my experience, the /libraries folder is in the same folder as the sketches. Maybe try moving your libraries folder to be in the sketchbook folder then see if that helps? Remember to quit & restart the Arduino IDE after moving the libraries folder.

The thing with the blue / black text is not indicative of anything unfortunately; the Arduino IDE highlights anything inside double-quotes in blue. The stuff that's showing up in orange is because the words are mentioned in the keywords.txt files of their associated libraries.

Good luck!
User avatar
Stephanie
 
Posts: 286
Joined: Sat Dec 11, 2010 12:17 am
Location: Canada

Re: Can't get RTClib to be recognized

Postby petespaco » Sat May 12, 2012 11:20 am

Oh, boy, Stephanie---
Thank you for your input.
I did as you suggested (it's now the day after I wrote my original post). This computer was turned off overnight.
I added a "libraries" subdirectory within the Arduino1.0 sketchbook directory. To that directory, I added an "RTClib" subdirectory. I put the three files:
keywords.txt, RTClib.cpp and RTClib.h into this new RTClib directory.
And the program in question now "verifies" with no errors! But now, it works with either <> or "" around the RTClib.h !!!

I guess I could feel good that it does work, but why, then would the other two #includes, (SD and Wire) have worked properly (caused no verify problems) since their subdirectories don't exist inside the sketchbook folder?
Just another note on SD and Wire--- since they DO appear in Orange, i'd guess it means that program IS finding their libraries, else they couldn't be Orange. Right?

I must still be missing something,
petespaco
-----------
petespaco
 
Posts: 21
Joined: Thu Apr 19, 2012 6:53 pm
Location: west central wisconsin

Re: Can't get RTClib to be recognized

Postby adafruit_support_rick » Sat May 12, 2012 12:07 pm

The SD and Wire libraries are part of the Arduino distribution. I'm not familiar with Windows installations, either, but I suspect you'll find them in the Arduino application folder, or maybe someplace in My Documents - if the Arduino install created any folders there.

User libraries go in the sketchbook folder. That's supposed to be the difference between the <x.h> and "x.h" notation (although either seems to work for user libraries, as you've seen).
User avatar
adafruit_support_rick
 
Posts: 2882
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Can't get RTClib to be recognized

Postby Stephanie » Sat May 12, 2012 12:38 pm

I've seen the <name.h> and "name.h" both work for the built-in Arduino libraries as well as the libraries added in the sketchbook. Where I have seen a difference is if you have extra files that exist within the directory for an individual sketch, then you 'must' use the "name.h" format.

Cheers!
User avatar
Stephanie
 
Posts: 286
Joined: Sat Dec 11, 2010 12:17 am
Location: Canada


Return to Arduino Shields from Adafruit

Who is online

Users browsing this forum: mibignistinly and 6 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]