diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-13 23:46:46 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-13 23:46:46 +0200 |
commit | f54375fa0958c3a79baf1444ee00161a7e6e0d6c (patch) | |
tree | 08760d7e7b2b6ab9d26e162e07dbb06766f9d428 /assignments/mqtt-with-button | |
parent | 7546fe3f1851a1f27ec6d72c76ce304f46102fca (diff) | |
download | iot-workshop-ndc-2018-f54375fa0958c3a79baf1444ee00161a7e6e0d6c.tar.gz iot-workshop-ndc-2018-f54375fa0958c3a79baf1444ee00161a7e6e0d6c.tar.bz2 iot-workshop-ndc-2018-f54375fa0958c3a79baf1444ee00161a7e6e0d6c.tar.xz iot-workshop-ndc-2018-f54375fa0958c3a79baf1444ee00161a7e6e0d6c.zip |
wip
Diffstat (limited to 'assignments/mqtt-with-button')
-rw-r--r-- | assignments/mqtt-with-button/mqtt-with-button.md | 14 | ||||
-rw-r--r-- | assignments/mqtt-with-button/mqtt-with-button.pdf | bin | 841020 -> 841066 bytes | |||
-rw-r--r-- | assignments/mqtt-with-button/schematic/mqtt-with-button.fzz | bin | 24221 -> 24142 bytes | |||
-rw-r--r-- | assignments/mqtt-with-button/schematic/mqtt-with-button_bb.pdf | bin | 449304 -> 449659 bytes | |||
-rw-r--r-- | assignments/mqtt-with-button/schematic/mqtt-with-button_schem.pdf | bin | 305478 -> 308141 bytes |
5 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 diff --git a/assignments/mqtt-with-button/mqtt-with-button.pdf b/assignments/mqtt-with-button/mqtt-with-button.pdf Binary files differindex 93079d7..8fcccf7 100644 --- a/assignments/mqtt-with-button/mqtt-with-button.pdf +++ b/assignments/mqtt-with-button/mqtt-with-button.pdf diff --git a/assignments/mqtt-with-button/schematic/mqtt-with-button.fzz b/assignments/mqtt-with-button/schematic/mqtt-with-button.fzz Binary files differindex 57e5e5d..1f56f4e 100644 --- a/assignments/mqtt-with-button/schematic/mqtt-with-button.fzz +++ b/assignments/mqtt-with-button/schematic/mqtt-with-button.fzz diff --git a/assignments/mqtt-with-button/schematic/mqtt-with-button_bb.pdf b/assignments/mqtt-with-button/schematic/mqtt-with-button_bb.pdf Binary files differindex aa0d283..8ba636a 100644 --- a/assignments/mqtt-with-button/schematic/mqtt-with-button_bb.pdf +++ b/assignments/mqtt-with-button/schematic/mqtt-with-button_bb.pdf diff --git a/assignments/mqtt-with-button/schematic/mqtt-with-button_schem.pdf b/assignments/mqtt-with-button/schematic/mqtt-with-button_schem.pdf Binary files differindex 3ce5de3..5d97abf 100644 --- a/assignments/mqtt-with-button/schematic/mqtt-with-button_schem.pdf +++ b/assignments/mqtt-with-button/schematic/mqtt-with-button_schem.pdf |