Pages: [1]   Go Down
Author Topic: RTC DS1307 library  (Read 1293 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

i want to create a simple clock. Therefor I use the RTC DS1307 module. I'm really searching for a library, which is described easily.

I found a tutorial with a library called "RTClib.h". I downloaded the RTClib.h and the RTClib.cpp and added this to my projekt like this: (first picture) (this are tabs next to my main code)

Then I wanted to include the informations I got from the example sketch (http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html) to my program. But when I started with the first command "RTC.begin();", I got an errorlike this (2nd attachment).

I'm sure that I inluded the library in a wrong way. How do I have to do this?


* RTC.jpg (2.43 KB, 163x49 - viewed 35 times.)

* Sketch.jpg (56.36 KB, 626x918 - viewed 88 times.)
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

RTC is not declared, because it is not declared.

Did you see this line in the example sketch:
Code:
RTC_DS1307 RTC;
That is where the class RTC is declared and initialized.
« Last Edit: January 10, 2013, 11:31:31 pm by Krodal » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't need to post screenshots of your sketch, and your error message. It's much simpler to copy and paste the actual text (of both) and post them here inside code tags (the # button above the posting area).
Logged

Pages: [1]   Go Up
Jump to: