4-Digit 7-Segment LED Weather (refreshing problem) Core

How can I refresh the mutex 4-Digit 7-Segment LED While fetching weather every five minutes. The LED is the same as this one http://www.learningaboutelectronics.com/Articles/4-digit-7-segment-LED-circuit-with-an-arduino.php

My loop looks like

void loop() {
    // Get some data
    String data = String(10);
    digitalWrite(led, HIGH);
    // Trigger the webhook
    Particle.publish("weather_hook", data, PRIVATE);
    displayWeather();
    // Wait 60*10 seconds
    delay(60000);
}

I want to run displayWeather() continously to get a good frame rate and fetch weather via webhook every 10 minutes.

Update: https://docs.particle.io/reference/firmware/photon/#software-timers would this help?

Timers could work, if applied correctly, but so would non-blocking delays. Both are worthwhile looking in to, and playing around with.

Thank you. Timers crashed.
https://community.particle.io/t/blocking-vs-non-blocking/3406/3
This made the magic.

2 Likes