Skip to content

Commit c3cea1a

Browse files
authored
Merge pull request #607 from arduino/karlsoderby/iotc-maintenance-oct21
[MKC-718] IoTC Maintenance
2 parents c7c4939 + 314dd8b commit c3cea1a

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

content/arduino-cloud/01.getting-started/02.technical-reference/iot-cloud-tech-ref.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ This feature allows Arduino devices to communicate with each other by sharing va
131131
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.
132132
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.
133133

134+
### Local Time
135+
136+
To retrieve local time, use the `ArduinoCloud.getLocalTime()` method in your sketch. The value returned represents the current local time expressed as a Unix timestamp (i.e. seconds from the epoch), and it automatically takes your time zone settings and DST (Daylight Saving Time) into account. Time zone can be set in the Thing configuration page within the Arduino IoT Cloud platform.
137+
138+
The returned timestamp can be displayed in a dashboard using a `CloudTime` variable and the [Time Picker widget](/arduino-cloud/getting-started/technical-reference#time-picker), or can be parsed with a third-party library such as [Time](https://www.arduino.cc/reference/en/libraries/time/) in case you want to show it on a display.
139+
140+
```arduino
141+
myTimeVariable = ArduinoCloud.getLocalTime()
142+
```
143+
144+
***Note that when using a board equipped with a hardware Real-Time Clock (RTC) the [Arduino_IoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud) library will use it automatically, thus communicating with the RTC from within your sketch or other libraries is not recommended. You can use the `getLocalTime()` and `getInternalTime()` methods provided by Arduino_IoTCloud instead.
145+
***
146+
134147
## Things
135148

136149
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.
@@ -153,7 +166,7 @@ The steps below can be used as guidance when **setting up a Thing**:
153166

154167
## Variables
155168

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

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

Loading

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ else if(stepperVariable == 11){
126126
Serial.println(stepperVariable);
127127
```
128128

129+
### Time Picker
130+
131+
![Time Picker Widget](assets/time-picker.png)
132+
133+
The time picker widget is used to represent and set a time and/or a date.
134+
135+
Can be linked with a **CloudTime** variable.
136+
137+
An example of how it is used in a sketch:
138+
139+
```
140+
CloudTimeVariable = ArduinoCloud.getLocalTime();
141+
```
142+
143+
In this example, the variable named `CloudTimeVariable` is populated with `ArduinoCloud.getLocalTime()` which returns the Unix time stamp (in seconds) of the local time zone.
144+
129145
### Messenger
130146

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

0 commit comments

Comments
 (0)