Device status (online/offline) on dashboard

Hello
Can someone help me with code and display device status (online/offline) on dashboard? Arduino cloud
Like:

I found something like this:


ArduinoCloud.update();
//Your code here


if (ArduinoCloud.connected()) {
    Serial.println("Cloud Connection Sucess");
    num=random(100);
    Serial.println("rh"+String(rh));
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
  }
  else{
    Serial.println("#NO CLOUD CONNECTION#");
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000)

;

But how to use this with a widget

Ciao I suggest to take a look at the events and callbacks.
https://docs.arduino.cc/arduino-cloud/features/arduino-cloud-callbacks/

You can find full examples
Cheers

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.