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 a30a1c1 commit 4db598eCopy full SHA for 4db598e
examples/Actuators/ServoMotor/ServoMotor.ino
@@ -51,4 +51,13 @@ CAYENNE_IN(VIRTUAL_CHANNEL)
51
int position = getValue.asDouble() * 180;
52
// Move the servo to the specified position.
53
s1.write(position);
54
-}
+}
55
+
56
+// This function is called at intervals to send data to Cayenne and keep the device online.
57
+// Will create a temporary green widget on Channel 0, make it permanent by clicking on '+'.
58
+CAYENNE_OUT(0)
59
+{
60
+ CAYENNE_LOG("Send data for Virtual Channel 0");
61
+ // This command writes the device's uptime in seconds to the Virtual Channel.
62
+ Cayenne.virtualWrite(0, millis() / 1000);
63
0 commit comments