Skip to content

Commit afa985d

Browse files
authored
Merge pull request #45 from arduino/sync/karlsoderby/cloud-sheet-cheat
Update IoT Cloud Cheat Sheet [MKC-322]
2 parents af90ec1 + 67c7053 commit afa985d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

content/cloud/iot-cloud/tutorials/02.technical-reference/iot-cloud-tech-ref.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,9 @@ The example below shows a basic code generated in the `thingProperties.h` file a
513513
***Please note: for READ & WRITE variables a callback function (in this case called `onVariableName01Change()`) is automatically generated in sketch. This will allow for writing commands inside the function to trigger actions whenever the value is changed from the cloud.***
514514

515515
```arduino
516-
517516
#include ArduinoIoTCloud.h
518517
#include Arduino_ConnectionHandler.h
519518
520-
const char THING_ID[] = "A-UNIQUE-THING-ID-NUMBER";
521-
522519
const char SSID[] = SECRET_SSID; // Network SSID (name)
523520
const char PASS[] = SECRET_PASS; // Network password (use for WPA, or use as key for WEP)
524521
@@ -529,16 +526,23 @@ CloudTemperature Variable_Name_02; // declare a Cloud specific temperature varia
529526
530527
void initProperties(){
531528
532-
ArduinoCloud.setThingId(THING_ID);
533529
ArduinoCloud.addProperty(Variable_Name_01, READWRITE, ON_CHANGE, onVariableName01Change); // linking the read & write variable with its function and updating it on change
534530
ArduinoCloud.addProperty(Variable_Name_02, READ, 10 * SECONDS, NULL); // setting up the read only variable and updating it every 10 seconds
535531
536532
}
537533
538534
WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); // setting up the network name and password chosen in the Network configuration
535+
```
536+
537+
***As of 2022/02/09 the `thingProperties.h` no longer contains your Thing ID. If you have created a Thing prior to this date, simply update your Thing and your `thingProperties.h` will automatically be updated. You can see the lines that were removed in the snippet below:***
539538

539+
```arduino
540+
const char THING_ID[] = "A-UNIQUE-THING-ID-NUMBER";
541+
542+
ArduinoCloud.setThingId(THING_ID); //previously located inside initProperties()
540543
```
541544

545+
542546
### sketch.ino
543547

544548
This file includes the main Arduino sketch that can be **edited and uploaded to the device**. The sketch includes the `thingProperties.h` file, the `setup()` and `loop()` functions, and an empty function for every **Read & Write** variable. The code below is a basic example of an auto generated code in the sketch file, using the same variables from the previous example displayed in `thingProperties.h` section.
@@ -585,7 +589,7 @@ Uploading a sketch through the Arduino IoT Cloud can be achieved in two ways, ei
585589

586590
The full editor allows for more control over the code and its libraries and provides access to all files included in the sketch, as well as more editing and sharing options.
587591

588-
***Please note: the status of the connection to the Network and Arduino IoT Cloud may be checked by opening the **Serial Monitor** after uploading a sketch. If the `while(!Serial);` loop is included in the `setup()` function, the code would not execute before opening the **Serial Monitor**.***
592+
***Please note: the status of the connection to the Network and Arduino IoT Cloud may be checked by opening the Serial Monitor after uploading a sketch. If the `while(!Serial);` loop is included in the `setup()` function, the code would not execute before opening the Serial Monitor.***
589593

590594

591595
## Dashboards

0 commit comments

Comments
 (0)