Rftop
May 17, 2019, 12:45am
2
These 2 posts by @ScruffR might be a good starting point.
I'm sure there are many others.
Give it a try and then folks can help you figure out specific problems in your Code.
Particle.connected() is a class function/method not a class field.
Hence you are missing the parenthesis in if (Particle.connected). This way you just “check” whether the function exists, but don’t acutally call it.
You need to write it as if (Particle.connected())
But I’d rather go with this
Particle.connect();
if (waitFor(Particle.connected, 60000)) {
digitalWrite(D7, HIGH);
delay(2000);
Serial.printlnf("Connected to Particle Cloud.");
Serial.printlnf("Start synchroni…
First I’d not test for multiple fields when checking for a time but for the combined time - easiest would be seconds as this is what Time.local() gives you back already.
Next I would not check for equality but always for greater or equal in conjunction with a “once per day” flag, otherwise you may miss a whole day when you miss the particular second.
So I’d go with something like this
const int timeAction = 18*3600 + 14*60 + 00; // hh+mm+ss
int previousDay = 0;
void setup() {
Time.zone(you…
1 Like