What I want from Arduino to read the time 22:00:00 either from Serial Monitor or directly through DS3231 and execute some task,suppose "digitalWrite, HIGH" the LED and when the time reaches to 22:00:59, the LED should be OFF.
iTECHKING:
What I want from Arduino to read the time 22:00:00 either from Serial Monitor or directly through DS3231 and execute some task,suppose "digitalWrite, HIGH" the LED and when the time reaches to 22:00:59, the LED should be OFF.
Your description is not clear.
Do you want to be able to enter a time on the Serial Monitor and then have the Arduino check the time from the RTC and act when it matches the entered time?
Do you want to be able to enter a time on the Serial Monitor and then have the Arduino check the time from the RTC and act when it matches the entered time?
No, Not as you say.
Let me explain. I have uploaded a program in Arduino Uno to show the current date and time.
Arduino shows the current date and time running in RTC through Serial Monitor window.
Now, I want Arduino to execute a task when it reaches to a pre-defined time (say 09:00:00).
As the time in RTC reached to 9 AM, a task should be executed.
Hope I am clear now.
iTECHKING:
Now, I want Arduino to execute a task when it reaches to a pre-defined time (say 09:00:00).
As the time in RTC reached to 9 AM, a task should be executed.
Where will the pre-defined time come from - will it be in your program code? I had assumed you wanted to enter it (i.e. to be able to change it) from the Serial Montor.
If you want more help please also post your program so we can see what you are trying and what libraries you may be using.
And when posting code please use the code button </>so your code looks like thisand is easy to copy to a text editor See How to use the Forum
Robin2:
Where will the pre-defined time come from - will it be in your program code? I had assumed you wanted to enter it (i.e. to be able to change it) from the Serial Montor.
If you want more help please also post your program so we can see what you are trying and what libraries you may be using.
And when posting code please use the code button </>
Yes, you got exactly what I want to say. The predefined time will be defined in the Arduino program.
#include <Wire.h>
#include "ds3231.h"
int LedOnTime=1800; // Time 24 hours time format at which LED should be ON
int LedOffTime=1900; // Time 24 hours time format at which LED should be OFF
void setup()
{
---
---
}
void loop
(
// code to keep monitoring the RTC to reach predefined time and as soon as RTC
reaches "LedOnTime" , it should execute a task.
}