We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b1f7c7 commit ea04837Copy full SHA for ea04837
examples/CustomWidgets/ButtonWidget/ButtonWidget.ino
@@ -47,3 +47,12 @@ CAYENNE_IN(VIRTUAL_CHANNEL)
47
// Write the value received to the digital pin.
48
digitalWrite(ACTUATOR_PIN, value);
49
}
50
+
51
+// This function is called at intervals to send data to Cayenne and keep the device online.
52
+// Will create a temporary green widget on Channel 0, make it permanent by clicking on '+'.
53
+CAYENNE_OUT(0)
54
+{
55
+ CAYENNE_LOG("Send data for Virtual Channel 0");
56
+ // This command writes the device's uptime in seconds to the Virtual Channel.
57
+ Cayenne.virtualWrite(0, millis() / 1000);
58
+}
0 commit comments