diff --git a/examples/DeviceInfo/DeviceInfo.ino b/examples/DeviceInfo/DeviceInfo.ino index 7ff37598..e0467f6c 100644 --- a/examples/DeviceInfo/DeviceInfo.ino +++ b/examples/DeviceInfo/DeviceInfo.ino @@ -3,7 +3,7 @@ #define debugSerial Serial #define loraSerial Serial1 -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { @@ -12,14 +12,14 @@ void setup() delay(3000); - ttu.init(loraSerial, debugSerial); + ttn.init(loraSerial, debugSerial); } void loop() { debugSerial.println("Device Information"); debugSerial.println(); - ttu.showStatus(); + ttn.showStatus(); debugSerial.println(); debugSerial.println("Use the EUI to register the device for OTAA"); debugSerial.println("-------------------------------------------"); diff --git a/examples/Downlink/downlink.ino b/examples/Downlink/downlink.ino index 3530bdc2..14d43c62 100644 --- a/examples/Downlink/downlink.ino +++ b/examples/Downlink/downlink.ino @@ -10,7 +10,7 @@ const byte appKey[16] = { }; //for example: {0x73, 0x6D, 0x24, 0 #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { @@ -18,14 +18,14 @@ void setup() loraSerial.begin(57600); delay(1000); - ttu.init(loraSerial, debugSerial); //Initializing... - ttu.reset(); - if (!ttu.join(appEui, appKey)) { + ttn.init(loraSerial, debugSerial); //Initializing... + ttn.reset(); + if (!ttn.join(appEui, appKey)) { delay(6000); } delay(6000); - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); delay(1000); @@ -35,13 +35,13 @@ void loop() { // Send a byte byte buf[1]; buf[0] = 20; - int downlinkBytes = ttu.sendBytes(buf, 1); + int downlinkBytes = ttn.sendBytes(buf, 1); if (downlinkBytes > 0) { debugPrintLn("Received " + String(downlinkBytes) + " bytes") // Print the received bytes for (int i = 0; i < downlinkBytes; i++) { - debugPrint(String(ttu.downlink[i]) + " "); + debugPrint(String(ttn.downlink[i]) + " "); } debugPrintLn(); } diff --git a/examples/SendABP/SendABP.ino b/examples/SendABP/SendABP.ino index cd0aa312..7bd99c2d 100644 --- a/examples/SendABP/SendABP.ino +++ b/examples/SendABP/SendABP.ino @@ -16,21 +16,21 @@ String message = "Hello world"; //sending a string of chars "Hello world" #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { debugSerial.begin(115200); loraSerial.begin(57600); delay(1000); - ttu.init(loraSerial, debugSerial); - ttu.reset(); + ttn.init(loraSerial, debugSerial); + ttn.reset(); //the device will configure the LoRa module - ttu.personalize(devAddr, nwkSKey, appSKey); + ttn.personalize(devAddr, nwkSKey, appSKey); delay(6000); - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); delay(1000); @@ -38,6 +38,6 @@ void setup() { void loop() { - ttu.sendString(message); + ttn.sendString(message); delay(20000); } diff --git a/examples/SendOTAA/SendOTAA.ino b/examples/SendOTAA/SendOTAA.ino index 573b910f..b2358e52 100644 --- a/examples/SendOTAA/SendOTAA.ino +++ b/examples/SendOTAA/SendOTAA.ino @@ -13,31 +13,31 @@ String message = "Hello world"; //sending a string of chars "Hello world" #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { debugSerial.begin(115200); loraSerial.begin(57600); delay(1000); - ttu.init(loraSerial, debugSerial); - ttu.reset(); + ttn.init(loraSerial, debugSerial); + ttn.reset(); //the device will attempt a join every second till the join is successfull - while(!ttu.join(appEui, appKey)){ + while(!ttn.join(appEui, appKey)){ delay(6000); } digitalWrite(13, HIGH); //turn on LED to confirm join delay(6000); - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); delay(1000); } void loop() { - ttu.sendString(message); + ttn.sendString(message); delay(20000); } diff --git a/examples/SensorExamples/DHTSensor/DHTSensor.ino b/examples/SensorExamples/DHTSensor/DHTSensor.ino index 7cc99783..ea39e5e6 100644 --- a/examples/SensorExamples/DHTSensor/DHTSensor.ino +++ b/examples/SensorExamples/DHTSensor/DHTSensor.ino @@ -24,7 +24,7 @@ byte data[4]; #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { debugSerial.begin(115200); @@ -33,18 +33,18 @@ void setup() { dht.begin(); delay(1000); - ttu.init(loraSerial, debugSerial); - ttu.reset(); + ttn.init(loraSerial, debugSerial); + ttn.reset(); //the device will attempt a join every second till the join is successfull - while(!ttu.join(appEui, appKey)){ + while(!ttn.join(appEui, appKey)){ delay(6000); } digitalWrite(13, HIGH); //turn on LED to confirm join delay(6000); - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); delay(1000); @@ -65,7 +65,7 @@ void loop() { debugPrint("Humidity: "); debugPrintLn(humidity); //send data - ttu.sendBytes(data, sizeof(data)); + ttn.sendBytes(data, sizeof(data)); delay(20000); } diff --git a/examples/SensorExamples/LightSensor/LightSensor.ino b/examples/SensorExamples/LightSensor/LightSensor.ino index f3a5652c..ce175085 100644 --- a/examples/SensorExamples/LightSensor/LightSensor.ino +++ b/examples/SensorExamples/LightSensor/LightSensor.ino @@ -16,7 +16,7 @@ byte data[2]; #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { debugSerial.begin(115200); @@ -25,18 +25,18 @@ void setup() { pinMode(LightPin, INPUT); delay(1000); - ttu.init(loraSerial, debugSerial); - ttu.reset(); + ttn.init(loraSerial, debugSerial); + ttn.reset(); //the device will attempt a join every second till the join is successfull - while(!ttu.join(appEui, appKey)){ + while(!ttn.join(appEui, appKey)){ delay(6000); } digitalWrite(13, HIGH); //turn on LED to confirm join delay(6000); - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); delay(1000); @@ -52,7 +52,7 @@ void loop() { debugPrint("Transmitting Light level: "); debugPrintLn(light); //send data - ttu.sendBytes(data, sizeof(data)); + ttn.sendBytes(data, sizeof(data)); delay(20000); } diff --git a/examples/Workshop/Workshop.ino b/examples/Workshop/Workshop.ino index 5210b10e..32841a4b 100644 --- a/examples/Workshop/Workshop.ino +++ b/examples/Workshop/Workshop.ino @@ -23,7 +23,7 @@ const byte appSKey[16] = { ... }; #define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); } #define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); } -TheThingsNetwork ttu; +TheThingsNetwork ttn; void setup() { // Set up the serial interfaces for the debugging serial monitor and LoRa module @@ -32,14 +32,14 @@ void setup() { delay(1000); // Initialize and reset The Things Uno - ttu.init(loraSerial, debugSerial); - ttu.reset(); + ttn.init(loraSerial, debugSerial); + ttn.reset(); // Here we activate the device with your address and keys - ttu.personalize(devAddr, nwkSKey, appSKey); + ttn.personalize(devAddr, nwkSKey, appSKey); // Show the status on the debugging serial monitor - ttu.showStatus(); + ttn.showStatus(); debugPrintLn("Setup for The Things Network complete"); } @@ -48,7 +48,7 @@ void loop() { byte data[3] = { 0x01, 0x02, 0x03 }; // Send it to the network - ttu.sendBytes(data, sizeof(data)); + ttn.sendBytes(data, sizeof(data)); // Wait 10 seconds delay(10000);