diff --git a/examples/binary-sensor/binary-sensor.ino b/examples/binary-sensor/binary-sensor.ino index 89f878e..a39fd39 100644 --- a/examples/binary-sensor/binary-sensor.ino +++ b/examples/binary-sensor/binary-sensor.ino @@ -1,7 +1,8 @@ #include #include -#define INPUT_PIN 9 +#define INPUT_PIN 9 +#define BROKER_ADDR IPAddress(192,168,0,17) byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A}; unsigned long lastReadAt = millis(); @@ -24,7 +25,7 @@ void setup() { device.setSoftwareVersion("1.0.0"); // please change IP address to yours - mqtt.begin(IPAddress(192,168,0,17)); + mqtt.begin(BROKER_ADDR); } void loop() { diff --git a/examples/led-switch/led-switch.ino b/examples/led-switch/led-switch.ino index 2c091f0..4156cd4 100644 --- a/examples/led-switch/led-switch.ino +++ b/examples/led-switch/led-switch.ino @@ -1,7 +1,8 @@ #include #include -#define LED_PIN 9 +#define LED_PIN 9 +#define BROKER_ADDR IPAddress(192,168,0,17) byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A}; @@ -30,7 +31,7 @@ void setup() { led.onStateChanged(onSwitchStateChanged); // please change IP address to yours - mqtt.begin(IPAddress(192,168,0,17)); + mqtt.begin(BROKER_ADDR); } void loop() { diff --git a/examples/mqtt-with-credentials/mqtt-with-credentials.ino b/examples/mqtt-with-credentials/mqtt-with-credentials.ino index bd65d45..d4a1399 100644 --- a/examples/mqtt-with-credentials/mqtt-with-credentials.ino +++ b/examples/mqtt-with-credentials/mqtt-with-credentials.ino @@ -1,9 +1,10 @@ #include #include -#define LED_PIN 9 -#define USERNAME "user" // replace with your credentials -#define PASSWORD "pass" +#define LED_PIN 9 +#define BROKER_ADDR IPAddress(192,168,0,17) +#define BROKER_USERNAME "user" // replace with your credentials +#define BROKER_PASSWORD "pass" byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A}; @@ -32,7 +33,7 @@ void setup() { led.onStateChanged(onSwitchStateChanged); // please change IP address to yours - mqtt.begin(IPAddress(192,168,0,17), USERNAME, PASSWORD); + mqtt.begin(BROKER_ADDR, BROKER_USERNAME, BROKER_PASSWORD); } void loop() { diff --git a/examples/sensor/sensor.ino b/examples/sensor/sensor.ino index 981f86d..08118a4 100644 --- a/examples/sensor/sensor.ino +++ b/examples/sensor/sensor.ino @@ -1,6 +1,8 @@ #include #include +#define BROKER_ADDR IPAddress(192,168,0,17) + byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A}; unsigned long lastSentAt = millis(); double lastValue = 0; @@ -34,7 +36,7 @@ void setup() { temp.setUnitOfMeasurement("°C"); // please change IP address to yours - mqtt.begin(IPAddress(192,168,0,17)); + mqtt.begin(BROKER_ADDR); } void loop() {