Skip to content

Commit 7ab0da5

Browse files
committed
IoT Cloud Variables Update
1 parent b92b942 commit 7ab0da5

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,19 @@ You can use them just like a normal variable of the wrapped type, since they sup
182182

183183
The following variable types hold multiple values internally and are used to represent more complex data. In order to access such values, methods are provided.
184184

185+
#### CloudSchedule
186+
187+
`CloudSchedule` is used to check for an active state or to retrieve the timestamp.
188+
189+
| Description | Type | Read value |
190+
| ---------------------- | ------ | ----------------------- |
191+
| Check for active state | `bool` | `x.isActive()` |
192+
| From (start date) | `int` | `x.getCloudValue().frm` |
193+
| To (end date)\* | `int` | `x.getCloudValue().to` |
194+
| Length of Timestamp | `int` | `x.getCloudValue().len` |
195+
196+
\*If no end date is selected, value is defaulted to `0`.
197+
185198
#### DimmedLight
186199

187200
Declared as `CloudDimmedLight x;`
@@ -195,24 +208,26 @@ Declared as `CloudDimmedLight x;`
195208

196209
Declared as `CloudColoredLight x;`
197210

198-
| Property | Type | Read value | Set value |
199-
| ---------- | --------------- | ------------------- | ------------------- |
200-
| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` |
201-
| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` |
202-
| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` |
203-
| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` |
211+
| Property | Type | Read value | Set value |
212+
| ---------- | ----------------- | ------------------- | ------------------- |
213+
| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` |
214+
| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` |
215+
| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` |
216+
| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` |
217+
| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.setRGB(r,g,b)` |
204218

205219
#### CloudColor
206220

207221
Declared as `CloudColor x;`.
208222

209223
To read the Color values, we can use the following method `Color colorValues = x.getValue();`. This will assign the hue, saturation, and brightness values to the `colorValues` variable.
210224

211-
| Property | Type | Read value | Set value |
212-
| ---------- | ------- | ----------------- | -------------------------------------- |
213-
| Hue | `float` | `colorValues.hue` | `x = Color(hue,saturation,brightness)` |
214-
| Saturation | `float` | `colorValues.sat` | `x = Color(hue,saturation,brightness)` |
215-
| Brightness | `float` | `colorValues.bri` | `x = Color(hue,saturation,brightness)` |
225+
| Property | Type | Read value | Set value |
226+
| ---------- | ----------------- | ----------------- | -------------------------------------- |
227+
| Hue | `float` (0-360) | `colorValues.hue` | `x = Color(hue,saturation,brightness)` |
228+
| Saturation | `float` (0-100) | `colorValues.sat` | `x = Color(hue,saturation,brightness)` |
229+
| Brightness | `float` (0-100) | `colorValues.bri` | `x = Color(hue,saturation,brightness)` |
230+
| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.set(r,g,b)` |
216231

217232
To set the color, we can assign the CloudColor variable directly to float variables `x = {hue,saturation,brightness}`, or using the method ` x = Color(hue,saturation,brightness)`.
218233

0 commit comments

Comments
 (0)