From 5ec40ac294aa8f092b3f70dca1cb6d103699a995 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 8 May 2018 10:08:32 +0200 Subject: wip --- assignments/Makefile | 3 ++- assignments/README.md | 2 +- assignments/README.pdf | Bin 128533 -> 129305 bytes assignments/read-a-button/read-a-button.md | 12 ++++++++++++ assignments/read-a-button/read-a-button.pdf | Bin 0 -> 321997 bytes .../read-a-button/schematic/read-a-button.fzz | Bin 0 -> 22670 bytes .../read-a-button/schematic/read-a-button_bb.pdf | Bin 0 -> 446283 bytes .../schematic/read-a-button_schem.pdf | Bin 0 -> 273880 bytes assignments/read-temperature/read-temperature.md | 1 + assignments/read-temperature/read-temperature.pdf | Bin 791810 -> 794796 bytes .../solution/read-temperature/read-temperature.ino | 10 ++++++++++ 11 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 assignments/read-a-button/read-a-button.md create mode 100644 assignments/read-a-button/read-a-button.pdf create mode 100644 assignments/read-a-button/schematic/read-a-button.fzz create mode 100644 assignments/read-a-button/schematic/read-a-button_bb.pdf create mode 100644 assignments/read-a-button/schematic/read-a-button_schem.pdf (limited to 'assignments') diff --git a/assignments/Makefile b/assignments/Makefile index ad3e8be..e1ec335 100644 --- a/assignments/Makefile +++ b/assignments/Makefile @@ -1,9 +1,10 @@ AS = AS += blink-a-led -AS += read-temperature AS += mqtt AS += mqtt2 AS += mqtt3 +AS += read-a-button +AS += read-temperature PDFS=$(foreach A,$(AS),$(A)/$(A).pdf) diff --git a/assignments/README.md b/assignments/README.md index a6f4dc3..a18e1cf 100644 --- a/assignments/README.md +++ b/assignments/README.md @@ -24,7 +24,7 @@ which should include "NodeMCU 1.0 (ESP-12E Module)". * TimeAlarms * WifiManager * *DHT sensor library* by Adafruit -* *Adafruit sensor library* by Adafruit +* *Adafruit unified sensor* by Adafruit ## Install Python 3 diff --git a/assignments/README.pdf b/assignments/README.pdf index df80c8d..1a2a2a5 100644 Binary files a/assignments/README.pdf and b/assignments/README.pdf differ diff --git a/assignments/read-a-button/read-a-button.md b/assignments/read-a-button/read-a-button.md new file mode 100644 index 0000000..2cf7592 --- /dev/null +++ b/assignments/read-a-button/read-a-button.md @@ -0,0 +1,12 @@ +# Read a button + +## Step 1 + +Wire up this schematic on the bread board: + +![](schematic/read-a-button_schem.pdf) + +## Step 2 + +* Change sampling frequency + diff --git a/assignments/read-a-button/read-a-button.pdf b/assignments/read-a-button/read-a-button.pdf new file mode 100644 index 0000000..057d0a1 Binary files /dev/null and b/assignments/read-a-button/read-a-button.pdf differ diff --git a/assignments/read-a-button/schematic/read-a-button.fzz b/assignments/read-a-button/schematic/read-a-button.fzz new file mode 100644 index 0000000..bb4263a Binary files /dev/null and b/assignments/read-a-button/schematic/read-a-button.fzz differ diff --git a/assignments/read-a-button/schematic/read-a-button_bb.pdf b/assignments/read-a-button/schematic/read-a-button_bb.pdf new file mode 100644 index 0000000..8473764 Binary files /dev/null and b/assignments/read-a-button/schematic/read-a-button_bb.pdf differ diff --git a/assignments/read-a-button/schematic/read-a-button_schem.pdf b/assignments/read-a-button/schematic/read-a-button_schem.pdf new file mode 100644 index 0000000..bc957bc Binary files /dev/null and b/assignments/read-a-button/schematic/read-a-button_schem.pdf differ diff --git a/assignments/read-temperature/read-temperature.md b/assignments/read-temperature/read-temperature.md index 1037ba9..31a32a8 100644 --- a/assignments/read-temperature/read-temperature.md +++ b/assignments/read-temperature/read-temperature.md @@ -1,3 +1,4 @@ +# Read the temperature and humidity sensor DHT22 ## Step 1 diff --git a/assignments/read-temperature/read-temperature.pdf b/assignments/read-temperature/read-temperature.pdf index 51e3c1b..f1ec641 100644 Binary files a/assignments/read-temperature/read-temperature.pdf and b/assignments/read-temperature/read-temperature.pdf differ diff --git a/assignments/read-temperature/solution/read-temperature/read-temperature.ino b/assignments/read-temperature/solution/read-temperature/read-temperature.ino index 71e860e..b261dc5 100644 --- a/assignments/read-temperature/solution/read-temperature/read-temperature.ino +++ b/assignments/read-temperature/solution/read-temperature/read-temperature.ino @@ -7,8 +7,18 @@ const auto DHTTYPE = DHT22; DHT_Unified dht(DHTPIN, DHTTYPE); void setup() { + Serial.begin(115200); + pinMode(D2, INPUT); + pinMode(D0, OUTPUT); } void loop() { + if (digitalRead(D2) == HIGH) { + Serial.println("HIGH"); + } else { + Serial.println("LOW"); + } + digitalWrite(D0, digitalRead(D2)); + delay(100); } -- cgit v1.2.3