Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;`
Expand All @@ -195,24 +208,26 @@ 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

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)`.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down