Getting error on compilation.

Hello. I am new here.

I was trying to make this irrigation controller. " http://www.apcc.tk/diy-projects/rainmaker"
Its the original code (Attached file) and i didnt changed anything in the code.

But when i try to compile the code, it gives me error like this…

sketch_sep27a.ino: In function ‘void handleButtons(int, boolean)’:
sketch_sep27a:259: error: ‘RTC’ was not declared in this scope
sketch_sep27a:259: error: ‘DS1307_HR’ was not declared in this scope
sketch_sep27a:260: error: ‘DS1307_MIN’ was not declared in this scope
sketch_sep27a:261: error: ‘DS1307_SEC’ was not declared in this scope
sketch_sep27a:262: error: ‘DS1307_DOW’ was not declared in this scope
sketch_sep27a:292: error: ‘RTC’ was not declared in this scope
sketch_sep27a:292: error: ‘DS1307_HR’ was not declared in this scope
sketch_sep27a:293: error: ‘DS1307_MIN’ was not declared in this scope
sketch_sep27a:294: error: ‘DS1307_SEC’ was not declared in this scope
sketch_sep27a:295: error: ‘DS1307_DOW’ was not declared in this scope
sketch_sep27a:379: error: ‘RTC’ was not declared in this scope
sketch_sep27a.ino: In function ‘void loop()’:
sketch_sep27a:457: error: ‘RTC’ was not declared in this scope
sketch_sep27a:457: error: ‘DS1307_HR’ was not declared in this scope
sketch_sep27a:458: error: ‘DS1307_MIN’ was not declared in this scope
sketch_sep27a:459: error: ‘DS1307_SEC’ was not declared in this scope
sketch_sep27a:460: error: ‘DS1307_DOW’ was not declared in this scope

anyone tell me what i am doing wrong or missing?

note that i am using Arduino ide 1.0.5 r2

Thanks in advance.

V3_23_03.pde (24.3 KB)

                                 case 1: ++hourT; if (hourT == 24) hourT=0; RTC.set(DS1307_HR,hourT); time_day (2);  break;

Well, where did you declare the RTC instance you are trying to use here?

As i said before, i didnt changed the code. That code was straight from that website created by the author. :drooling_face:

did you download and import the library to your Arduino IDE?

#include <DS1307.h>

it seems that you do not have the library installed for using an DS1307 RealTime Clock The link you provide does not give a link to the lib but there are several around. Might take some code tweaking to match the library to the actual code.

The extension .pde indicates that the code is written in a pre Arduino 1.0 IDE , as from then on the .ino extension is used. So you might get some small incompatibilities too.

Which IDE version are you using?

I am using Arduino 1.0.5 r2 ide.

And yes i have the DS1307 library installed in my library path.
Actually i saw few of the ds1307 library around web, tried them individually by deleting old one and install them one by one, at a time. but unfortunately none of them worked.

I got error every time i tried to compile the code. =(

BulldogLowell:
did you download and import the library to your Arduino IDE?

#include <DS1307.h>

Yes i downloaded the library. but no works… =( =( =( =(

Did you shut the IDE down while installing the new libraries and then restart the IDE?

Where exactly did you put the libraries, and did you preserve the correct subtree for it? Each library goes in an appropriately named subdirectory of libraries directory.

econjack: Did you shut the IDE down while installing the new libraries and then restart the IDE?

yes every time i install any library, i do shut the ide and restart the application.

MarkT: Where exactly did you put the libraries, and did you preserve the correct subtree for it? Each library goes in an appropriately named subdirectory of libraries directory.

"E:\arduino-1.0.5-r2-windows\arduino-1.0.5-r2\libraries"

this is where i place the extracted folder containing the *.cpp and *.h file. nothing changed.

I found many version of the ds1307 library file on web. tried few of them but none of them worked.

Where did you get those libraries from?

See this:

LCD4Bit_mod is not compatible with versions > arduino 0.23.

“E:\arduino-1.0.5-r2-windows\arduino-1.0.5-r2\libraries”

That is not the place for your libraries believe it or not.

xtalmagic: I found many version of the ds1307 library file on web. tried few of them but none of them worked.

We can't reproduce your problem if we have to guess which one you used, or where you found the other libraries like the LCD8Bit_mod one (or AnalogButtons).

Hi Nick. Thanks for your quick reply.

Yes. The fault in was my library path and also in the lcd4bit library.

I correctly installed all the library in exact location. and for the lcd4bit library, i changed the header of lcd4bit_mod.cpp file like this…

#include “LCD4Bit_mod.h”
#if (ARDUINO < 100)
extern “C” {
#include <stdio.h> //not needed yet
#include <string.h> //needed for strlen()
#include <inttypes.h>
#include “WProgram.h”
}
#else
#include <Arduino.h>
#endif

and finally, it compile like a racing car… XD

I am so glad that you all helped me and finally get it solved.
Again, Thanks for Teaching me new things. :wink:

Hi all. Again i have to comment on this post. As i told that the code compile successfully, but it actually not.

Well, it did, but unfortunately the lcd goes crazy and no button works.

But when i tried to compile the code again it gives me error like this.....

In file included from V3_23_03.pde:6:
C:\Users\Documents\Arduino\libraries\AnalogButtons/AnalogButtons.h:52: error: 'boolean' does not name a type
C:\Users\Documents\Arduino\libraries\AnalogButtons/AnalogButtons.h:85: error: 'boolean' has not been declared
C:\Users\Documents\Arduino\libraries\AnalogButtons/AnalogButtons.h:88: error: 'boolean' has not been declared
V3_23_03:112: error: invalid conversion from 'void (*)(int, boolean)' to 'void (*)(int, int)'
V3_23_03:112: error: initializing argument 3 of 'AnalogButtons::AnalogButtons(int, int, void (*)(int, int))'

Now i think i should change the code for work with new ide.

And thats the point i need help.

i dont want to use lcd4bit. just want to use lcdkeypad shields withliquidcrystal library on pinD4-D9 instead. as well the button provided with the shield.

anyone wish to help me please???

Anyone help me doing this?

You have errors in your libraries possibly due to them not being updated to work with the new IDE.

You could try to locate a new copy of the library or use an older version of the IDE.