aboutsummaryrefslogtreecommitdiff
path: root/assignments/mqtt-with-button/mqtt-with-button.md
diff options
context:
space:
mode:
Diffstat (limited to 'assignments/mqtt-with-button/mqtt-with-button.md')
-rw-r--r--assignments/mqtt-with-button/mqtt-with-button.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/assignments/mqtt-with-button/mqtt-with-button.md b/assignments/mqtt-with-button/mqtt-with-button.md
index 77f0b22..c825615 100644
--- a/assignments/mqtt-with-button/mqtt-with-button.md
+++ b/assignments/mqtt-with-button/mqtt-with-button.md
@@ -16,13 +16,17 @@ Wire up this schematic on the bread board:
# Step 2
-* Read button, print message on terminal
+* Tip: change upload speed to max.
+
+* Read button in `loop()`. If the button's state changes, print a
+ message.
+
+*Note:* reading the button in a busy loop is not really a best
+practice as it uses lots of energy. Instead use the `attachInterrupt`.
# Step 3
* Connect to the Wi-Fi network
- * Use `WiFi.localIP()`
-
* Connect to MQTT broker
# Step 4
@@ -32,6 +36,10 @@ Wire up this schematic on the bread board:
# Step 5 (Bonus)
+Subscripe to a topic and do something with the led.
+
+* Subscribe to the topic you're publishing to.
+
* Subscribe to the topic `ndc/$device-id/led`.
* Use the value to for example turn the LED on/off, or change the