We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c2313e commit 79dde56Copy full SHA for 79dde56
examples/Blinker_MQTT/MQTT_WiFi/MQTT_WiFi.ino
@@ -1,6 +1,8 @@
1
#define BLINKER_PRINT Serial
2
#define BLINKER_MQTT
3
4
+#define BUTTON_1 "ButtonKey"
5
+
6
#include <Blinker.h>
7
8
char auth[] = "<Your MQTT Secret Key>";
@@ -10,7 +12,11 @@ char pswd[] = "<Your WiFi network WPA password or WEP key>";
10
12
void setup() {
11
13
Serial.begin(115200);
14
15
+ pinMode(LED_BUILTIN, OUTPUT);
16
+ digitalWrite(LED_BUILTIN, LOW);
17
18
Blinker.begin(auth, ssid, pswd);
19
+ Blinker.wInit(BUTTON_1, W_BUTTON);
20
}
21
22
void loop()
@@ -26,4 +32,8 @@ void loop()
26
32
Blinker.print(BlinkerTime);
27
33
Blinker.print("millis", BlinkerTime);
28
34
35
36
+ if (Blinker.button(BUTTON_1)) {
37
+ digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
38
+ }
29
39
0 commit comments