Go Down

Topic: getting help with the delay function (Read 729 times) previous topic - next topic

santiagohaime19

will this code be functional in real life? I'm using the RTC DS1307?

void loop
{

DateTime now = rtc.now();

int i;

for(i=0 ; i >10 ; i++)
{

<do something

delay(now.year())


}

the program says compile done but not sure if this will work?

my question is can this codes will work in real life?

i just want a per year delay for my thesis thanks

TolpuddleSartre

#1
Apr 07, 2018, 11:19 am Last Edit: Apr 07, 2018, 11:20 am by TolpuddleSartre
now.year will return something like 2018, so if you want a 2018 millisecond delay, then yes, it will work.

Next year, it will delay 2019 milliseconds.

Go Up