Gravity I2C DS1307 RTC Module SKU DFR0151

Hello there,

I am trying to use the Gravity I2C DS1307 RTC Module SKU DFR0151 with my Arduino Nano.
But i do not even manage to compile the code provided by gravity (there : Gravity__I2C_DS1307_RTC_Module_SKU__DFR0151-DFRobot) in the Arduino IDE.
There are a lot of error messages, for example:
"sketch_dec03bis:29:5: error: 'RTC' was not declared in this scope
RTC.get(rtc,true);"
I think there's a problem with the library DS1307.h.
i've tried many other progams provided on the internet but I cannot manage to find any working for that module.
Do you know where I can find one?
An easy one so I can understand it :slight_smile:
Thanks a lot!
Cheers

Did you

Please download DFRobot DS1307 RTC library. How to install Libraries in Arduino IDE

as requested on the website you link?

a7

Thanks, I tried but the link does not work "404 error"

Yes, I see that too, Trying

hang on.

OK that link should work. You need to have installed the very same library the author wrote against when he created the sketch.

a7

I tried that one too... (the program, which is different, and the library, which has a different name) and it did not work. Which is why I'm quite lost.
I'm not sure the I2C module I've chosen is the most adapted one (I "just" want to add the time of measurements in a SD card that is recording temperature every 10 min or so).
That is why i'm looking for a simple progam (if it exists somewhere) since I'm a beginner in all that :slight_smile:
Thanks

I've managed to find the irght library, but now I've got a conenction problem I think.
I've got an arduino nano and a Arduino Nano IO Shield SKU DFR0012.
And I'm trying to connect the Gravity I2C DS1307 RTC Module SKU DFR0151 using the IC/TW ports of the shield (5V/GND/SCL/SDA) but there are no data exchanged, the conenction does not seem right.
i've put a photo of the set-up (sorry for the quality).

Thanks a lot,
Cheers

Disconnect everything except the RTC.

Get the RTC to work with a simple example that you had nothing to do with writing and do not change.

Do that with any other I2C devices, each one separately testing with a simple example program.

Or say you did that.

Also google

i2c scanner arduino

and poke around, there are sketches that do nothing but look at your I2C bus and report what is found.

a7

Thanks a lot!
Actually I did scan using a program I found and there was nothing with either RTC or light sensor. And then I saw a switch on the shield (Nano V3/Nano V4), and now it works :slight_smile:
And I can finally enjoy trying to connect everything altogether (I'll certainly have some difficulties at some point but that's a huge step for me, thanks again)!

Yay!

We here. Step by step…

a7