jurs:
Name of the devices?
The device name I will use is relay1, relay2, rela3, relay4.
Four Relays I will use to turn on the Lights in 4 Rooms.
jurs:
Which country are you located?
My location in Indonesia.
jurs:
How exactly do you need your timed switching?
Is it “daily switching times by the minute”, and “accuracy up to a couple of seconds” is enough?
Or do you need switching times accurate to less than one second?
How do you want to define switching times?
Compile switching times into the program?
On or off will be arranged according to lecture hour, for example we enter the room at 07.30 until 10.00 in the room to one then Relay1 will live until 10.00 and will Off if it exceeds that time. If we log in again at 14.00 to 17.00 then Relay1 will turn back until 17:00 and will Off if it exceeds that time. So every day time switch will be adjusted to the schedule of the lecture we take so that the light will light up when we enter the room and will Off if it indicates the time out.
So also with the second, third and fourth rooms, adjusting to the time of entry and exit from our college schedule.
If you created a source code sample for me, then I will try to adjust to what I want to create.
For example the logic I use you can see on the piece of RTC DS1302 code I made.
// Pin 2 will be assigned a value of 0 to light at 07:30:00 and will be rated 1 for Off at 10:00:00.
if (myRTC.hours == 07 & myRTC.minutes == 30 & myRTC.seconds == 0)
{
digitalWrite(2, LOW);
}
else if (myRTC.hours == 10 & myRTC.minutes == 0 & myRTC.seconds == 0)
{
digitalWrite(2, HIGH);
}
jurs:
Or do you want to create a user interface for editing all switching times in a web browser?
So that a user can enter/edit switching times and then “send” new switching times to the Arduino? This would be somewhat more complicted than to compile all switching times into the code.
Actually I want to make it, but it seems to be a bit more difficult and takes a long time for me to do. Therefore I do not make it difficult, but if you can help me why not.
With the Web Interface is indeed easier for users to set the time On / Off according to the schedule of lectures we take.