rtc DS1307 will not display in serial monitor

Where did you put the two libraries?

i put them into G:\arduino\arduino-0022\libraries thats where they should have gone correct?

Starting a few revision back, arduino IDE suggests all contributed libraries to be located under arduino-0022\sketches\libraries
Post your code.
Did arduino IDE compile your code without error?

here is the code im usung to test it with the lines marked with the * are the ones that dont light up like the wire line does
and as far as compiling if i use the code that is givin in the examples from sketch it will but if i use this one it says that rtc is not declared in the scope

#include <WProgram.h>*
#include <Wire.h>
#include <DS1307.h> *// written by mattt on the Arduino forum and modified by D. Sjunnesson

void setup()
{
Serial.begin(9600);

RTC.stop();
RTC.set(DS1307_SEC,1); //set the seconds
RTC.set(DS1307_MIN,23); //set the minutes
RTC.set(DS1307_HR,12); //set the hours
RTC.set(DS1307_DOW,4); //set the day of the week
RTC.set(DS1307_DATE,15); //set the date
RTC.set(DS1307_MTH,7); //set the month
RTC.set(DS1307_YR,10); //set the year
RTC.start();

}

void loop()
{

Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
Serial.print(":");
Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
Serial.print(":");
Serial.print(RTC.get(DS1307_SEC,false));//read seconds
Serial.print(" "); // some space for a more happy life
Serial.print(RTC.get(DS1307_DATE,false));//read date
Serial.print("/");
Serial.print(RTC.get(DS1307_MTH,false));//read month
Serial.print("/");
Serial.print(RTC.get(DS1307_YR,false)); //read year
Serial.println();

delay(1000);
}

What is the full path of the DS1307.h file? You need to put the folder under sketches\libraries\

I run that identical sketch and it works fine. I suspect you possibly didn't create a folder called DS1307 inside the libraries folder which then contains the needed .h and .cpp files. Here is my folder set-up for the DS1307 files:

C:\Documents and Settings\Primary Windows User\My Documents\Arduino\libraries\DS1307

1 Folders:

examples

3 Files:

DS1307.cpp
DS1307.h
DS1307.o

Lefty

yes i did create a folder its called DS1307RTC this is what it contains in it

ds1307rtc.cpp
ds1307rtc.h
keywords
readme

wich is what was extracted from the zip folder i got from emartees webpage
and i put it in the subfolders libraries

Make sure you are using upper or lower cases consistently. Not all systems allow a mix. Plus in your code you had <DS1307.h> but in your latest reply you had DS1307rtc.h

That was not consistent either.

here is the code im usung to test it with the lines marked with the * are the ones that dont light up like the wire line does

That is not an issue, they aren't highlighted in my sketch either. That is just because the distributed library doesn't include a keyword file.

So what doesn't work when you compile and run your sketch, just no serial output? Are you using a V4 shield board like in the ad? If so did you make sure the two jumpers are in the IIC position? Are you using the proper 4 pin 'buckle connector" ?

Lefty

yes everything im usining ids excatly like it is on the page from emartee. and as i stated b4 i get nothing in the serial monitor unless i unplug the dang chip. now how many of you are actually trying to help me intead of just guessing and how many of you ate actually trying this with the clock shield? all of you are saying the same thing and its annoying me to no end.

There are only 10 of us (in case you can't count) trying to help you and you shouldn't be angry with either of us. We didn't sell you the stuff, we don't necessarily have what you just bought, and we both see the same problem you have.

Make sure you are using upper or lower cases consistently. Not all systems allow a mix. Plus in your code you had <DS1307.h> but in your latest reply you had DS1307rtc.h

That was not consistent either.

Did you actually read what I wrote? Why the heck DS1307rtc.h and <DS1307.h>? You need help answering that question?

drab:
yes everything im usining ids excatly like it is on the page from emartee. and as i stated b4 i get nothing in the serial monitor unless i unplug the dang chip. now how many of you are actually trying to help me intead of just guessing and how many of you ate actually trying this with the clock shield? all of you are saying the same thing and its annoying me to no end.

Good luck then.

Yes i can count there partner. The reason you saw two diffrent ds1307 files is because like i said i dloaded it from emartee and if u looked there u would have saw there is 2 diffrent libraries there i tried both and said that in a previous post as well.

drab:
Yes i can count there partner. The reason you saw two diffrent ds1307 files is because like i said i dloaded it from emartee and if u looked there u would have saw there is 2 diffrent libraries there i tried both and said that in a previous post as well.

I am not sitting in front of your computer so all I can see is all you provided: naming DS1307rtc for library directory and file names but including DS1307 in arduino program. That was why original code compiled but your altered version didn't. Plus, if you keep consistent letter cases in all places, I wouldn't nag you on that either. I don't even know what operating system you use, obviously.

The "not declared in the scope" error is just a complaint that the compiler can't locate the include file. You should revert to original example code.

Again, you said the code did compile when you didn't alter the original program. Then what makes you want to ask for help?

"I can't get any data" What does that mean? Nothing shows up at all or nothing useful to you shows up? Again help me here, I'm not staring at your screen. Anything the serial monitor prints out is useful to helping you.

If I put it in another way, you have a sick child, you bring to the doctor, without any detail descriptions of symptoms you demand the doctor operate on your child.

ok srry if i was a bit harsh just frustrated finally got the library part taken care of i work alot so spare time is far between. i am using the code from RTC DS1307 Shield V1.0 - emartee.com wich is who i got the chip from according to thier web site when the code is uploaded you should open the serial monitor and see the result. theres a pic of the result on the page it showes the time scrolling with date. the code is this

#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h> // written by mattt on the Arduino forum and modified by D. Sjunnesson

void setup()
{
Serial.begin(9600);

RTC.stop();
RTC.set(DS1307_SEC,1); //set the seconds
RTC.set(DS1307_MIN,23); //set the minutes
RTC.set(DS1307_HR,12); //set the hours
RTC.set(DS1307_DOW,4); //set the day of the week
RTC.set(DS1307_DATE,15); //set the date
RTC.set(DS1307_MTH,7); //set the month
RTC.set(DS1307_YR,10); //set the year
RTC.start();

}

void loop()
{

Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
Serial.print(":");
Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
Serial.print(":");
Serial.print(RTC.get(DS1307_SEC,false));//read seconds
Serial.print(" "); // some space for a more happy life
Serial.print(RTC.get(DS1307_DATE,false));//read date
Serial.print("/");
Serial.print(RTC.get(DS1307_MTH,false));//read month
Serial.print("/");
Serial.print(RTC.get(DS1307_YR,false)); //read year
Serial.println();

delay(1000);
}
when i uploaad this code and run serial monitor the monitor display is blank
am i missing something pls help me out
and if i unplug the chip i get 0:0:0 0/0/2000

Don't know what's going on with this chip. If you try running the code with the RTC plugged in it shows nothing. What if at this moment you unplug it, will the serial monitor start display the zeros? Can you show me a picture how you connected the RTC to your arduino? We can't exclude a possibility that you screwed up the wiring :slight_smile: (very unlikely since the sockets are shrouded.

Yes if i unplug the chip it shows zeros. If u follow the link in my post and look at the page i have it hooked into the sensor shield and the shield set for the I2c as shown on the page from emartee.

drab:
Yes if i unplug the chip it shows zeros. If u follow the link in my post and look at the page i have it hooked into the sensor shield and the shield set for the I2c as shown on the page from emartee.

Just a random thought, is the battery inserted correctly with the right polarity? What happens if you connect the RTC without battery?

well i got it workin the wonerful chinese screwed up the wire that i bought with it. they wired the vcc and grnd to the opssitie side it needed to be on where it plugs into the chip. lol fixed it and works nice now. thx everyone.