diff --git a/content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md b/content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md index 8ea4488837..7d21ec648c 100644 --- a/content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md +++ b/content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md @@ -182,6 +182,19 @@ You can use them just like a normal variable of the wrapped type, since they sup 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. +#### CloudSchedule + +`CloudSchedule` is used to check for an active state or to retrieve the timestamp. + +| Description | Type | Read value | +| ---------------------- | ------ | ----------------------- | +| Check for active state | `bool` | `x.isActive()` | +| From (start date) | `int` | `x.getCloudValue().frm` | +| To (end date)\* | `int` | `x.getCloudValue().to` | +| Length of Timestamp | `int` | `x.getCloudValue().len` | + +\*If no end date is selected, value is defaulted to `0`. + #### DimmedLight Declared as `CloudDimmedLight x;` @@ -195,12 +208,13 @@ Declared as `CloudDimmedLight x;` Declared as `CloudColoredLight x;` -| Property | Type | Read value | Set value | -| ---------- | --------------- | ------------------- | ------------------- | -| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` | -| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` | -| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` | -| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` | +| Property | Type | Read value | Set value | +| ---------- | ----------------- | ------------------- | ------------------- | +| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` | +| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` | +| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` | +| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` | +| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.setRGB(r,g,b)` | #### CloudColor @@ -208,11 +222,12 @@ Declared as `CloudColor x;`. 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. -| Property | Type | Read value | Set value | -| ---------- | ------- | ----------------- | -------------------------------------- | -| Hue | `float` | `colorValues.hue` | `x = Color(hue,saturation,brightness)` | -| Saturation | `float` | `colorValues.sat` | `x = Color(hue,saturation,brightness)` | -| Brightness | `float` | `colorValues.bri` | `x = Color(hue,saturation,brightness)` | +| Property | Type | Read value | Set value | +| ---------- | ----------------- | ----------------- | -------------------------------------- | +| Hue | `float` (0-360) | `colorValues.hue` | `x = Color(hue,saturation,brightness)` | +| Saturation | `float` (0-100) | `colorValues.sat` | `x = Color(hue,saturation,brightness)` | +| Brightness | `float` (0-100) | `colorValues.bri` | `x = Color(hue,saturation,brightness)` | +| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.set(r,g,b)` | 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)`. diff --git a/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart-2.png b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart-2.png new file mode 100644 index 0000000000..5a142654a4 Binary files /dev/null and b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart-2.png differ diff --git a/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart.gif b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart.gif new file mode 100644 index 0000000000..45bbcbbf31 Binary files /dev/null and b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-advanced-chart.gif differ diff --git a/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-scheduler.png b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-scheduler.png new file mode 100644 index 0000000000..94f29c241d Binary files /dev/null and b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/assets/widget-scheduler.png differ diff --git a/content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md index 22dc299ffc..6de2fb591d 100644 --- a/content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md +++ b/content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md @@ -318,9 +318,49 @@ The chart widget is great for data analytics. It is used to track real time data An example of how it is used in a sketch: ```arduino -locationChart = analogRead(A0); +variable = analogRead(A0); ``` +### Advanced Chart + +![Advanced Chart Widget](assets/widget-advanced-chart.gif) + +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. + +![Widget Configuration](assets/widget-advanced-chart-2.png) + +An example of how it is used in code: + +```arduino +variable_1 = analogRead(A1) +variable_2 = analogRead(A2) +variable_3 = analogRead(A3) +variable_4 = analogRead(A4) +variable_5 = analogRead(A5) +``` + +***Check out the [Advanced Chart](/arduino-cloud/features/advanced-chart) guide for more information.*** + +### Scheduler + +![Scheduler Widget](assets/widget-scheduler.png) + +The Scheduler Widget allows you to schedule a job in the future. With this widget, you can schedule: +- A job to activate at a specific hour, minute and second. +- A job to execute only on specific days. +- A job that should last for X amount of seconds, minutes or hours. + +In a sketch, use the `x.isActive()` boolean to check whether a state is active. + +Example: + +```arduino +if(scheduleVariable.isActive){} +``` + + +***Check out the [Scheduler](/arduino-cloud/features/cloud-scheduler) guide for more information.*** + ### Sticky Note ![Sticky Note](assets/widget-sticky-note.png)