Coding a wake-up light, how to read RTC and use data


I am building my own wake-up light (see picture attached), which so far consists of a high power LED, RTC (DS3102) and button. I managed to set the time on the RTC (the serial monitor shows the correct time) but I can't figure out how to use that data to power the LED on a certain moment. I tried every library i could find but all im getting is a confused Arduino IDE. I have some experience with Arduino from university but that's about it.

my struggle:

  • Which command do I use (from which library) to tell my Arduino its (...) o'clock and i wanna wake up?

We can't see your code.

That's true, apologies.

here you go

#include <DS1302.h>

#include <Time.h>
#include <TimeLib.h>

DS1302 rtc(5, 6, 7);

int led = 9;

void setup() {


// rtc.halt(false);
// rtc.writeProtect(false);
// rtc.setDOW(WEDNESDAY);

void loop() {

// Get data from the DS1302


delay (1000);

if (rtc.getTimeStr() == "12:35")

That code won't compile.

Please remember to use code tags when posting code.

Yes that is the reason im here.

how do libraries work? why are the commands from the header file not recognised after including the library? Why are some commands first deemed wrong but after verifying the third or fourth time it works?

Assuming you have the library, you need to put the code that should be in the loop() function, but isn't.