Skip to content

Commit 9d5882d

Browse files
committed
Fix iot section code
1 parent 75051cc commit 9d5882d

File tree

1 file changed

+9
-14
lines changed
  • content/hardware/09.kits/maker/nesso-n1/tutorials/user-manual

1 file changed

+9
-14
lines changed

content/hardware/09.kits/maker/nesso-n1/tutorials/user-manual/content.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,35 +137,30 @@ Because "Manual Devices" do not automatically generate a downloadable sketch, yo
137137
5. Paste the following code into `arduino_secrets.h` and fill in your details:
138138

139139
```cpp
140-
#define SECRET_SSID "YOUR_WIFI_SSID"
141-
#define SECRET_OPTIONAL_PASS "YOUR_WIFI_PASSWORD"
142-
#define SECRET_DEVICE_LOGIN_NAME "YOUR_DEVICE_ID" // From Step 1
143-
#define SECRET_DEVICE_KEY "YOUR_SECRET_KEY" // From Step 1
140+
#define SECRET_WIFI_SSID "YOUR_WIFI_SSID"
141+
#define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD"
142+
#define SECRET_DEVICE_ID "YOUR_DEVICE_ID" // From Step 1
143+
#define SECRET_DEVICE_KEY "YOUR_SECRET_KEY" // From Step 1
144144
```
145145

146146
6. Create another new tab named `thingProperties.h` and paste the following configuration code:
147147

148148
```cpp
149149
#include <ArduinoIoTCloud.h>
150-
#include <Arduino_ConnectionHandler.h>
151150
#include "arduino_secrets.h"
152151

153-
const char SSID[] = SECRET_SSID;
154-
const char PASS[] = SECRET_OPTIONAL_PASS;
155-
const char DEVICE_LOGIN_NAME[] = SECRET_DEVICE_LOGIN_NAME;
156-
const char DEVICE_KEY[] = SECRET_DEVICE_KEY;
157-
158152
void onLedChange();
159153

160154
bool led;
161155

156+
WiFiConnectionHandler ArduinoIoTPreferredConnection(SECRET_WIFI_SSID, SECRET_WIFI_PASS);
157+
162158
void initProperties(){
163-
ArduinoCloud.setBoardId(DEVICE_LOGIN_NAME);
164-
ArduinoCloud.setSecretDeviceKey(DEVICE_KEY);
165159
ArduinoCloud.addProperty(led, READWRITE, ON_CHANGE, onLedChange);
160+
161+
ArduinoCloud.setBoardId(SECRET_DEVICE_ID);
162+
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
166163
}
167-
168-
WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS);
169164
```
170165

171166
7. Finally, paste the main application code into your `.ino` file:

0 commit comments

Comments
 (0)