Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RTC Problem
#1
Rainbow 
Any body help me ...


ds1307.cpp:5:20: error: RTClib.h: No such file or directory
ds1307.cpp:10: error: 'RTC_DS1307' does not name a type
ds1307.cpp: In function 'void setup()':
ds1307.cpp:15: error: 'RTC' was not declared in this scope
ds1307.cpp: In function 'void loop()':
ds1307.cpp:22: error: 'DateTime' was not declared in this scope
ds1307.cpp:22: error: expected `;' before 'now'
ds1307.cpp:24: error: 'now' was not declared in this scope
ds1307.cpp:44: error: expected `;' before 'future'
ds1307.cpp:47: error: 'future' was not declared in this scope

Thx ..
Reply
#2
(02-23-2013, 10:29 AM)eddyhasby Wrote: Any body help me ...

Hello,
you need to install the RTC library as described in the manual. There is a section for the installation which will guide you through the whole installation process.

Airic
Reply
#3
Thanks Airic ...
I can to upload RTC program now ..
Reply
#4
I have a arduino Uno and was wondering why the miniE sketch has problems with the RTClib. I searched for RTClib and found two versions:
- https://github.com/jcw/rtclib
- https://github.com/adafruit/RTClib

From the "miniE v1.1 Documentation.pdf" I understand that I should use the JCW version of the RTClib. So I removed the adafruit version and put the JCW RTClib folder in (PC) "C:/Program Files/Arduino/libraries/RTClib". Compiling gives the following error:

Code:
miniE:220: error: 'DateTime' does not name a type
miniE:458: error: 'RTC_DS1307' does not name a type
miniE:460: error: 'DateTime' does not name a type
miniE.ino: In function 'void setup()':
miniE:560: error: 'RTC' was not declared in this scope
miniE.ino: In function 'void loop()':
miniE:775: error: 'time' was not declared in this scope
miniE:775: error: 'RTC' was not declared in this scope
mE_eeprom.ino: In function 'void write_config()':
mE_eeprom:257: error: 'program_datetime' was not declared in this scope
mE_eeprom.ino: In function 'void load_config()':
mE_eeprom:341: error: 'program_datetime' was not declared in this scope
mE_program.ino: In function 'boolean check_programFuture()':
mE_program:58: error: 'program_datetime' was not declared in this scope
mE_program:58: error: 'time' was not declared in this scope
mE_program.ino: In function 'void add_newProgram()':
mE_program:88: error: 'program_datetime' was not declared in this scope
mE_program:88: error: 'RTC' was not declared in this scope
mE_program.ino: In function 'void delete_program()':
mE_program:127: error: 'program_datetime' was not declared in this scope
mE_program.ino: In function 'void check_programs()':
mE_program:183: error: 'time' was not declared in this scope
mE_program:195: error: 'time' was not declared in this scope
mE_program:195: error: 'program_datetime' was not declared in this scope
mE_program:208: error: 'time' was not declared in this scope
mE_program:208: error: 'program_datetime' was not declared in this scope
mE_ui.ino: In function 'void do_screen()':
mE_ui:272: error: 'time' was not declared in this scope
mE_ui_content.ino: In function 'void paint_status_screen()':
mE_ui_content:168: error: 'time' was not declared in this scope
mE_ui_content.ino: In function 'void fill_screen_array()':
mE_ui_content:319: error: 'program_datetime' was not declared in this scope
mE_ui_content:329: error: 'program_datetime' was not declared in this scope
mE_ui_content.ino: In function 'void paint_status_time()':
mE_ui_content:1240: error: 'time' was not declared in this scope
mE_ui_content:1261: error: 'RTC' was not declared in this scope
mE_ui_content:1261: error: 'time' was not declared in this scope
mE_ui_content:1267: error: 'time' was not declared in this scope
mE_ui_content:1268: error: 'time' was not declared in this scope
mE_ui_content.ino: In function 'void paint_status_program_time()':
mE_ui_content:1350: error: 'program_datetime' was not declared in this scope

What can I do to get the sketch compiled?

Thanks in advance,
Casper
Reply
#5
Hello

Are you sure that the Arduino SDK is loading the libraries from this location on your machine?

Also, did you place the actual files in the folder

...\libraries\RTClib\*.*

...and not in another subfolder in RTClib?

Airic
Reply
#6
(11-24-2013, 01:14 AM)Airic Lenz Wrote: Hello

Are you sure that the Arduino SDK is loding the libraries from this location on your machine?

Also, did you place the actual files in the folder

...\libraries\RTClib\*.*

...and not in another subfolder in RTClib?

Airic

Thanks Airic,

I work with the Arduino IDE version 1.05.

When I add the RTClib library accoording to the automatic installation of http://arduino.cc/en/Guide/Libraries than the lib is put into: "My Documents\Arduino\libraries" and can be refered with the "sketch > Import Library" menu in the contributed libraries.

Or with the manual installation of unzipped file's into "C:\Program Files\Arduino\libraries" than the lib can be refered with the normal list of libraries. You have to close and open the Arduino IDE to find the libraries listed.

I'm not shure what actually changed (I deleted the "My Documents\Arduino\libraries" folder, this crashed my Internet Explorer. After this, the libraries folder was restored after restarting the Internet Explorer. I manualy stored the RTClib into ""My Documents\Arduino\libraries". Eversince I'm able to compile the complete miniE sketch whitout any error.

Code:
Binary sketch size: 28,224 bytes (of a 32,256 byte maximum)

Swapping the RTClib to the "C:\Program Files\Arduino\libraries" folder, didn't changed the result anymore. I could compile the complete project.

Conclusion
Both directories can be used to store the unzipped files. The name of the Folder, the *.h and *.cpp filename must be exactly the same. Do not use "-" characters in the name. And use the RTClib from Jeelabs.

Regards,
Casper
Reply
#7
Hello

When i try to check or upload the code to my arduino uno I have the following error.

Stray '@' in a program

In file included from miniE.ino:33:
C:\Users\KK-ADMIN\Documents\Arduino\libraries\RTClib/RTClib.h:9: error: stray '\302' in program
C:\Users\KK-ADMIN\Documents\Arduino\libraries\RTClib/RTClib.h:9: error: stray '\267' in program
C:\Users\KK-ADMIN\Documents\Arduino\libraries\RTClib/RTClib.h:9: error: stray '\302' in program
C:\Users\KK-ADMIN\Documents\Arduino\libraries\RTClib/RTClib.h:9: error: stray '\267' in program
mE_camera:43: error: stray '@' in program
mE_camera.ino:89:10: error: invalid preprocessing directive #page
mE_camera.ino:90:2: error: invalid preprocessing directive #page
mE_camera.ino:91:2: error: invalid preprocessing directive #page
mE_camera:600: error: stray '@' in program
mE_camera:612: error: stray '@' in program
mE_camera:666: error: stray '$' in program
mE_camera:668: error: stray '$' in program
mE_camera:669: error: stray '$' in program
mE_camera:669: error: stray '$' in program
mE_camera:670: error: stray '$' in program
mE_camera:670: error: stray '$' in program
mE_camera:671: error: stray '$' in program
mE_camera:672: error: stray '$' in program
mE_camera:674: error: stray '$' in program
mE_camera:698: error: stray '$' in program
mE_camera:704: error: stray '$' in program
mE_camera:707: error: stray '$' in program
mE_camera:719: error: stray '$' in program
mE_camera:722: error: stray '$' in program
...
[shortenend by admin]

I already have checked the librtc and the folder is ok:

C:\Users\user\Documents\Arduino\libraries\RTClib is declared on the arduino program. I already download twice the files to the directories.

Can anyone please help me with this problem

Thank you in advance

Best regards
Reply
#8
(12-27-2013, 12:05 AM)nunokaneco Wrote: Stray '@' in a program

Hello, please try downloading the source-code again (btw. which version is it you are using?). The "stray" error usually means "forbidden / invisible characters" in your code. It looks like you have plenty of "$" and "@" signs in your code (and these are not part of the source-code). I guess some software in which you opened the files, "corrupted" them somehow.

Airic
Reply
#9
(12-27-2013, 06:55 PM)Airic Lenz Wrote:
(12-27-2013, 12:05 AM)nunokaneco Wrote: Stray '@' in a program

Hello, please try downloading the source-code again (btw. which version is it you are using?). The "stray" error usually means "forbidden / invisible characters" in your code. It looks like you have plenty of "$" and "@" signs in your code (and these are not part of the source-code). I guess some software in which you opened the files, "corrupted" them somehow.

Airic

Hello Airic

Yes it works now I download all the files again an it works like a charm Wink

Thank you for your support
Reply
#10
Can anybody show me how the compile looks like cause I cant get it write, thanks and I am sorry for being slow
I am getting this error
DateTime program_datetime[program_amount];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)