Skip to content

[MKC-718] IoTC Maintenance #607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -131,6 +131,18 @@ This feature allows Arduino devices to communicate with each other by sharing va
Using this feature you can link variables of the same data type between **two or more cloud-enabled devices**, and Arduino IoT Cloud will automatically ensure any change to their value is propagated among all linked boards.
For example, one button could set three smart bulbs to the same color by just setting a variable on one device and reading it on the others. Or you could turn on a heater when temperature sensors in your room or outside in your weather station drop below a certain level.

### Local Time
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alranel @pennam What do you think about this section?


To retrieve local time, use the `ArduinoCloud.getLocalTime()` function in a sketch. The value returned is the Unix timestamp or UTC, and automatically adjusts based DST (Daylight Time Savings) and the configured time zone. This is changed inside your Thing configuration.

This data can be stored in a `CloudTime` variable, and can be visualed using the [Time Picker widget](/arduino-cloud/getting-started/technical-reference#time-picker).

```arduino
myTimeVariable = ArduinoCloud.getLocalTime()
```

***Note that the [Arduino_IoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud) library creates an instance of `rtc`, using the [RTCZero](https://github.com/arduino-libraries/RTCZero) library. As there is only one hardware instance, you cannot have multiple `rtc` instances.***

## Things

In order to use your devices in IoT Cloud, you need to associate a Thing to each of them. A Thing is an abstract concept which holds the configuration of the variables and other settings, as well as the history of the data collected for the variables.
Expand All @@ -153,7 +165,7 @@ The steps below can be used as guidance when **setting up a Thing**:

## Variables

***Visit the main article on [Cloud Variables](arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***
***Visit the main article on [Cloud Variables](/arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***

A thing can have one or more variables. A variable can be used for multiple purposes:

Expand Down
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 @@ -126,6 +126,22 @@ else if(stepperVariable == 11){
Serial.println(stepperVariable);
```

### Time Picker

![Time Picker Widget](assets/time-picker.png)

The time picker widget is used to retrieve the local time on your board.

Can be linked with the **CloudTime** variable.

An example of how it is used in a sketch:

```
CloudTimeVariable = ArduinoCloud.getLocalTime();
```

***`ArduinoCloud.getLocalTime()` returns the Unix Time Stamp (counted in seconds).***

### Messenger

![Messenger Widget](assets/widget-messenger.png)
Expand Down