You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,17 @@ void onTestChange(){
103
103
}
104
104
```
105
105
106
+
There are a few different options available for synchronizing your sketch with the Arduino Cloud:
107
+
-`MOST_RECENT_WINS` - The latest update whether from the device or the cloud is used. Best for real-time applications where the latest data should always be used, regardless of source.
108
+
-`CLOUD_WINS` - The cloud value always overwrites the device value. Useful when the cloud holds critical configurations or settings that should always be enforced on the device.
109
+
-`DEVICE_WINS` - The device value always overwrites the cloud value. Used when the device generates important real-time data (sensor readings) that should always be preserved over cloud updates.
110
+
111
+
It can be set in your sketch with:
112
+
113
+
```arduino
114
+
setSyncPolicy(MOST_RECENT_WINS); // or CLOUD_WINS, DEVICE_WINS
115
+
```
116
+
106
117
### Configuration Header File
107
118
108
119
The `thingProperties.h` file is a non-editable file that updates based on changes made in your Thing. For example:
0 commit comments