I'm new to Arduino, using it on a Linux laptop. I can access it and run simple sketches.
I built a simple RTC circuit and am attempting to use it. I downloaded Time.zip and installed it via the IDE as per instructions.
When I attempted to run the TimeRTCSet sketch I got an error saying it could not find Time.h. Hmm... it was there where the installation put it- /home/keith/sketchbook/libraries/Time/Time/Time.h
Not knowing what else to do about it, I copied all the files up one directory. I also had to do this with /home/keith/sketchbook/libraries/Time/DS1307RTC/DS1307RTC.h
After I did that the sketch could find Time.h, Wire.h, and DS1307RTC.h, but won't compile giving a bunch of errors like these:
In file included from /home/keith/sketchbook/libraries/Time/DateStrings.cpp:10:0:
/home/keith/sketchbook/libraries/Time/DateStrings.cpp:18:18: error: variable ‘monthStr1’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
char monthStr1[] PROGMEM = "January";
^
/home/keith/sketchbook/libraries/Time/DateStrings.cpp:19:18: error: variable ‘monthStr2’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
char monthStr2[] PROGMEM = "February";
^
/home/keith/sketchbook/libraries/Time/DateStrings.cpp:20:18: error: variable ‘monthStr3’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’
char monthStr3[] PROGMEM = "March";
and so on. These don't look like PATH related issues, so I am at a loss to know what to do. I have not edited the sketch at all, it is the one included with the Time.zip library.
Can someone tell me what I've done wrong? And how to fix it?
Go through the library and edit it to correct the errors.
Install the 1.0.5 IDE from the Arduino website (it will coexist with the one from your distribution) and use that. The older version of the compiler will not complain about the PROGMEM variables not being declared const.
Hmm... I'm using Arduino 1:1.05 + dfsg2-2, but probably from the Debian repository (as you suggest), I don't actually remember which one I started with.
I'm a beginner, so I wouldn't know the first thing about how to correct the libraries.
Very puzzling. I think I will delete everything and start over, perhaps somewhere along the line I downloaded a conflicting library. This time I will use the IDE from the Arduino site, as you suggest.
I'm still having no luck getting the software to load properly. This time I tried uninstalling the Debain packaged Arduino then downloaded and uncompressed the tar ball from Arduino. Following the directions I also installed librxtx-java since I am using a UNO. Also following directions I did "export LD_LIBRARY_PATH=/usr/lib/jni" before invoking arduino, though this made no difference. I also downloaded and installed the Time.zip library and the DS1307RTC.zip (via the IDE).
I'm attempting to run the example sketch TimeRTCSet. This time I don't get any path errors, but I get these:
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
In file included from TimeRTCSet.pde:11:
/home/keith/sketchbook/libraries/DS1307RTC/DS1307RTC.h:17: error: ‘time_t’ does not name a type
/home/keith/sketchbook/libraries/DS1307RTC/DS1307RTC.h:18: error: ‘time_t’ has not been declared
/home/keith/sketchbook/libraries/DS1307RTC/DS1307RTC.h:19: error: ‘tmElements_t’ has not been declared
/home/keith/sketchbook/libraries/DS1307RTC/DS1307RTC.h:20: error: ‘tmElements_t’ has not been declared
TimeRTCSet:19: error: ‘time_t’ does not name a type
TimeRTCSet.pde: In function ‘void setup()’:
TimeRTCSet:16: error: ‘class DS1307RTC’ has no member named ‘get’
TimeRTCSet:16: error: ‘setSyncProvider’ was not declared in this scope
TimeRTCSet:17: error: ‘timeStatus’ was not declared in this scope
TimeRTCSet:17: error: ‘timeSet’ was not declared in this scope
TimeRTCSet.pde: In function ‘void loop()’:
TimeRTCSet:27: error: ‘time_t’ was not declared in this scope
TimeRTCSet:27: error: expected `;' before ‘t’
TimeRTCSet:28: error: ‘t’ was not declared in this scope
TimeRTCSet:31: error: ‘setTime’ was not declared in this scope
TimeRTCSet.pde: In function ‘void digitalClockDisplay()’:
TimeRTCSet:40: error: ‘hour’ was not declared in this scope
TimeRTCSet:41: error: ‘minute’ was not declared in this scope
TimeRTCSet:42: error: ‘second’ was not declared in this scope
TimeRTCSet:44: error: ‘day’ was not declared in this scope
TimeRTCSet:46: error: ‘month’ was not declared in this scope
TimeRTCSet:48: error: ‘year’ was not declared in this scope
TimeRTCSet.pde: At global scope:
TimeRTCSet:64: error: ‘time_t’ does not name a type
I also tried running the File > Examples > DS1307RTC > ReadTest sketch, with similar compile errors.
Am I missing some other instruction, some other required library? Or?
Anyone? Any of where to look for the cause of this problem? This is an example sketch so it should work if it is loaded properly with all required libraries.
Instead of attempting to use the DS1307RTC library from the Arduino site, I decided to try (again) Jeelab's RTClib-master library.
The first attempts at using Jeelab's library failed with all sorts of errors. Remember, I'm new to Arduino. So when I read the instructions to "change the name to RTClib" that's exactly what I did- I changed RTClib-master.zip to RTClib.zip. Then I tried to use the IDE to install it- wrong! I couldn't figure out why after changing the name it didn't work.
OK, so I finally figured out that I needed to change the name of the directory that is created when manually unzipping the file, which was not stated or obvious. Also, the fact that I had to manually move the now renamed directory to the proper place was not stated or obvious.
So, after going through all that, I've gotten the ds1307 sketch to compile properly! Yea!
I still have some problems- I'm getting gibberish instead of numbers in the Serial Monitor, but that's likely a problem with my hardware (which I am still looking into).