Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.

Commit decd0ca

Browse files
committed
Update sketch
include mqttClient.loop() in loop()
1 parent 765c705 commit decd0ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mqtt/mqtt_send_digital/mqtt_send_digital.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void setup() {
5454
// Initialize serial and wait for port to open:
5555
Serial.begin(9600);
5656
while (!Serial) {
57-
; // wait for serial port to connect. Needed for Leonardo only
57+
; // wait for serial port to connect. Needed for native USB port only
5858
}
5959

6060
setupWiFi();
@@ -114,6 +114,9 @@ void setupWiFi() {
114114
}
115115

116116
void loop() {
117+
// let the MQTT client process events
118+
mqttClient.loop();
119+
117120
// read the state of the pushbutton value:
118121
buttonState = digitalRead(buttonPin);
119122

0 commit comments

Comments
 (0)