Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: casampot on Mar 12, 2018, 03:17 am

Title: Controlling LED based on the real time... help please
Post by: casampot on Mar 12, 2018, 03:17 am
Hello ... please help me.. how can i turn ON a LED at 8am and turn OFF at 8:05am ... real time ... is it possible? Please i need your help about the codes.. thanks
Title: Re: Controlling LED based on the real time... help please
Post by: marco_c on Mar 12, 2018, 06:13 am
You will need a real time clock module (like the DS3231 module) and then a library that will allow you to read the time from the clock. When the time reaches your target, you turn the LED on.

What have you done so far?
Title: Re: Controlling LED based on the real time... help please
Post by: INTP on Mar 12, 2018, 06:17 am
Use an RTC Module.
Title: Re: Controlling LED based on the real time... help please
Post by: casampot on Mar 13, 2018, 03:18 am
Oh okay ... can you give me a sample code po turning a LED on at 8am and turn it off at 8:05?

Btw what is the library needed for the rtc module?
Title: Re: Controlling LED based on the real time... help please
Post by: INTP on Mar 13, 2018, 06:38 am
Buy the module. Look for RTC libraries. They will have code.
Get the clock working.
Then it's just as simple as an if condition for time.