Silly problem with SD shield revision

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
heliophagus
 
Posts: 20
Joined: Sun May 27, 2012 8:59 pm

Silly problem with SD shield revision

Post by heliophagus »

Greetings!

The SD shield worked wonderfully with the sketch on the tutorial web page. However, it did not timestamp the files. After downloading the version that allows files to be timestamped:

http://forums.adafruit.com/viewtopic.php?f=31&t=24814

I keep getting these errors each time I try to compile the sketch:

In file included from lighttemplogger.cpp:236:
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:5: error: redefinition of 'class DateTime'
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:5: error: previous definition of 'class DateTime'
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:29: error: redefinition of 'class RTC_DS1307'
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:29: error: previous definition of 'class RTC_DS1307'
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:39: error: redefinition of 'class RTC_Millis'
C:\Users\JL\Documents\Arduino-1.0.1\libraries\RTClib/RTClib.h:39: error: previous definition of 'class RTC_Millis'
lighttemplogger.pde:-1: error: redefinition of 'uint32_t syncTime'
lighttemplogger.pde:-1: error: 'uint32_t syncTime' previously defined here
lighttemplogger.pde:-1: error: redefinition of 'RTC_DS1307 RTC'
lighttemplogger.pde:-1: error: 'RTC_DS1307 RTC' previously declared here
lighttemplogger.pde:-1: error: redefinition of 'const int chipSelect'
lighttemplogger.pde:-1: error: 'const int chipSelect' previously defined here
lighttemplogger.pde:-1: error: redefinition of 'File logfile'
lighttemplogger.pde:-1: error: 'File logfile' previously declared here
lighttemplogger.cpp: In function 'void error(char*)':
lighttemplogger.pde:-1: error: redefinition of 'void error(char*)'
lighttemplogger.pde:-1: error: 'void error(char*)' previously defined here
lighttemplogger.cpp: In function 'void setup()':
lighttemplogger.pde:-1: error: redefinition of 'void setup()'
lighttemplogger.pde:-1: error: 'void setup()' previously defined here
lighttemplogger.cpp: In function 'void loop()':
lighttemplogger.pde:-1: error: redefinition of 'void loop()'
lighttemplogger.pde:-1: error: 'void loop()' previously defined here

Doubtless I am doing something truly idiotic. The above errors hold true even if I revert to the original program, which compiled and uploaded just fine the first time.

Any help would be greatly appreciated!

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Silly problem with SD shield revision

Post by adafruit_support_bill »

It looks like RTClib is getting included twice. Make sure you have only one copy of RTClib.h on your system.

User avatar
heliophagus
 
Posts: 20
Joined: Sun May 27, 2012 8:59 pm

Re: Silly problem with SD shield revision

Post by heliophagus »

The problem turned out to be my lack of familiarity with the Arduino environment (I'm more of a PIC and HiTech C guy). The IDE thought it was being helpful but ended up tripping over itself. Erasing the logger folder and re-downloading the file, this time sticking with Arduino naming conventions, fixed the problem.

The data logging shield's working like a champ, file date-stamps are now perfect, and the program is a great launching-point for developing other applications.

Yay Adafruit. 8)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”