One thing you definetly are missing in order to have
TimeAlarm work is the regular call to
loop() (as shown in the linked code).
What device is
Since the LOW/HIGH transition in your
scheduleA() will be rather short, you need a quite speedy device to catch that.
delay(15000) on the other hand should be avoided in there, rather use
How would “
if (deviceA == HIGH)” ever be not true, with the preceeding
(and I guess you actually mean
deviceA == D1 == 1 == HIGH will also never change - usually).
I’d not use
strdup() as it does dynamic memory allocation (which I try to avoid where possible on embedded devices) but you already know the expected max length of your data, so I’d rather go for
strncpy(stringArgs, cmd.c_str(), 7);
return hour*100 + minute; // give the return value a useful meaning and report back what was set
To test your code you can always use this
BTW: Looking at the thread title, this seems to be a totally unrelated question.
Could you please open a new thread when duscussing other issues. This also makes it easier and more valuable for users with similar problems and might even save us some time by avoiding to answer similar questions over and over again.
Having said this, I’ll split this question off into a new thread (have done)