#include <stdio.h>
#include <time.h>
time_t now;
struct tm *now_tm;
int h,m,s;
void setup(){
pinMode(D6,OUTPUT);
}
void loop ()
{
now = time(NULL);
now_tm = localtime(&now);
h = now_tm->tm_hour;
m = now_tm->tm_min;
s = now_tm->tm_sec;
if(h == 17 && m == 0 && s==0)
{
digitalWrite(D6,HIGH);
delay(100000);
digitalWrite(D6,LOW);
}
}
I don't know why my LED on pin D6 won't turn on when it's 17:00:00
I tried check it with other IF
condition and it worked fine
I count the hour, the minute and the second on visual and they showed the right value