Skip to content

Commit cf7cb12

Browse files
committed
add ArduinoPortentaH7Ethernet example
1 parent 762a2ab commit cf7cb12

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#define THINGER_SERIAL_DEBUG
2+
3+
#include <ThingerMbedEth.h>
4+
#include <ThingerPortentaOTA.h>
5+
#include "arduino_secrets.h"
6+
7+
ThingerMbedEth thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
8+
ThingerPortentaOTA ota(thing);
9+
10+
void setup() {
11+
// configure LED_BUILTIN for output
12+
pinMode(LED_BUILTIN, OUTPUT);
13+
14+
// open serial for debugging
15+
Serial.begin(115200);
16+
17+
// pin control example (i.e. turning on/off a light, a relay, etc)
18+
thing["led"] << digitalPin(LED_BUILTIN);
19+
20+
// resource output example (i.e. reading a sensor value, a variable, etc)
21+
thing["millis"] >> outputValue(millis());
22+
23+
// start thinger on its own task
24+
thing.start();
25+
26+
// more details at http://docs.thinger.io/arduino/
27+
}
28+
29+
void loop() {
30+
// use loop as in normal Arduino Sketch
31+
// use thing.lock() thing.unlock() when using/modifying variables exposed on thinger resources
32+
delay(1000);
33+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define USERNAME "your_user_name"
2+
#define DEVICE_ID "your_device_id"
3+
#define DEVICE_CREDENTIAL "your_device_credential"

0 commit comments

Comments
 (0)