Skip to content

Commit 4db598e

Browse files
authored
Update ServoMotor.ino
1 parent a30a1c1 commit 4db598e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/Actuators/ServoMotor/ServoMotor.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,13 @@ CAYENNE_IN(VIRTUAL_CHANNEL)
5151
int position = getValue.asDouble() * 180;
5252
// Move the servo to the specified position.
5353
s1.write(position);
54-
}
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

Comments
 (0)