Skip to content

Commit 39a0f64

Browse files
authored
Merge pull request #956 from arduino/karlsoderby/iotc-patch-mar30
Karlsoderby/iotc patch mar30
2 parents 8802381 + e559b5e commit 39a0f64

File tree

5 files changed

+67
-12
lines changed

5 files changed

+67
-12
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

133 KB
Loading
2.77 MB
Loading
103 KB
Loading

content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,49 @@ The chart widget is great for data analytics. It is used to track real time data
318318
An example of how it is used in a sketch:
319319

320320
```arduino
321-
locationChart = analogRead(A0);
321+
variable = analogRead(A0);
322322
```
323323

324+
### Advanced Chart
325+
326+
![Advanced Chart Widget](assets/widget-advanced-chart.gif)
327+
328+
The advanced chart widget allows you to track up to **5 variables simultaneously**. This widget also includes an additional configuration interface that appears while editing the widget.
329+
330+
![Widget Configuration](assets/widget-advanced-chart-2.png)
331+
332+
An example of how it is used in code:
333+
334+
```arduino
335+
variable_1 = analogRead(A1)
336+
variable_2 = analogRead(A2)
337+
variable_3 = analogRead(A3)
338+
variable_4 = analogRead(A4)
339+
variable_5 = analogRead(A5)
340+
```
341+
342+
***Check out the [Advanced Chart](/arduino-cloud/features/advanced-chart) guide for more information.***
343+
344+
### Scheduler
345+
346+
![Scheduler Widget](assets/widget-scheduler.png)
347+
348+
The Scheduler Widget allows you to schedule a job in the future. With this widget, you can schedule:
349+
- A job to activate at a specific hour, minute and second.
350+
- A job to execute only on specific days.
351+
- A job that should last for X amount of seconds, minutes or hours.
352+
353+
In a sketch, use the `x.isActive()` boolean to check whether a state is active.
354+
355+
Example:
356+
357+
```arduino
358+
if(scheduleVariable.isActive){}
359+
```
360+
361+
362+
***Check out the [Scheduler](/arduino-cloud/features/cloud-scheduler) guide for more information.***
363+
324364
### Sticky Note
325365

326366
![Sticky Note](assets/widget-sticky-note.png)

0 commit comments

Comments
 (0)