Pages: [1]   Go Down
Author Topic: Turning lamps off 12:00 - 01:00 PM  (Read 1676 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everybody,

I want to turn the lamps off such as between 12-1 pm or 5-6 pm with relay.
I have relaies, Arduino Ethernet (software v1.0.2) and basic knowledge about using arduino, but i have problems with software.
 
I tried to use that i read discussions about the "datetime" libraries.Although I solve a few problem like "BYTE",i couldn't do anything finally.


Would you mind if you let me know how can I do these project easily.Is there any way to do without using libraries and except timer(delay etc).Any simple way like Visual Basic or Pascal to got it a few code.


It is not important working with perfect timing.  Moreover, maybe it could be work with stability only feeding with adaptory etc.

Please help me immediately,I am in a hurry

Thanks for your interest
Logged

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3379
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My first though would be to look at the NTP examples. Send out for the time every say 10 seconds or so, and parse the hour out of it.
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 935
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not using a library will make your job much, much harder.  Included with the Time library is another library, TimeAlarms that does exactly what you need.  There is an example in the library zip file you download that shows specifically how to set up an alarm and how to deal with it.  Using time and timealarm will make your task quite simple and you won't have to use delay or anything like it.

http://playground.arduino.cc/Code/time

Just click on the download link and look through the examples in the download.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley

Thanks a lot all,

I fixed it using TimeAlarm is perfect idea. smiley-money And also, for other person that have similar problems,while using TimeAlarm example,i have one more problem which says:

C:\arduino-1.0\libraries\TimeAlarm\TimeAlarm.cpp:268: error: 'millis' was not declared in this scope

And than,I solve it with these;

https://www.element14.com/community/thread/16455

Link says that find these adress Documents/Arduino/Libraries/TimeAlarm/TimeAlarm.cpp
and open it and change the #include < WProgram.h > line to #include < Arduino.h >

That's all.

You can also use these unit;

https://www.sparkfun.com/products/99

it provides you real timing.Moreover,you turn the arduinos power off,unless you think if the setting time will be gone.With other words,you shouldn't set the arduino's time,like in the example every upload bacause of the fact that it has a simple timer logic,you set the time and date,though.

Thanks again for your interest,

See you in next project,questions or solutions.
Logged

Pages: [1]   Go Up
Jump to: