diff options
Diffstat (limited to 'assignments/old/read-temperature')
-rw-r--r-- | assignments/old/read-temperature/read-temperature.md | 13 | ||||
-rw-r--r-- | assignments/old/read-temperature/read-temperature.pdf | bin | 0 -> 794796 bytes | |||
-rw-r--r-- | assignments/old/read-temperature/schematic/read-temperature.fzz | bin | 0 -> 23036 bytes | |||
-rw-r--r-- | assignments/old/read-temperature/schematic/read-temperature_bb.pdf | bin | 0 -> 392490 bytes | |||
-rw-r--r-- | assignments/old/read-temperature/schematic/read-temperature_schem.pdf | bin | 0 -> 354997 bytes | |||
-rw-r--r-- | assignments/old/read-temperature/solution/read-temperature/read-temperature.ino | 24 |
6 files changed, 37 insertions, 0 deletions
diff --git a/assignments/old/read-temperature/read-temperature.md b/assignments/old/read-temperature/read-temperature.md new file mode 100644 index 0000000..31a32a8 --- /dev/null +++ b/assignments/old/read-temperature/read-temperature.md @@ -0,0 +1,13 @@ +# Read the temperature and humidity sensor DHT22 + +## Step 1 + +Wire up this schematic on the bread board: + +![](schematic/read-temperature_schem.pdf) + +![](schematic/read-temperature_bb.pdf) + +## Step 2 + +* Change sampling frequency diff --git a/assignments/old/read-temperature/read-temperature.pdf b/assignments/old/read-temperature/read-temperature.pdf Binary files differnew file mode 100644 index 0000000..f1ec641 --- /dev/null +++ b/assignments/old/read-temperature/read-temperature.pdf diff --git a/assignments/old/read-temperature/schematic/read-temperature.fzz b/assignments/old/read-temperature/schematic/read-temperature.fzz Binary files differnew file mode 100644 index 0000000..52a9fa0 --- /dev/null +++ b/assignments/old/read-temperature/schematic/read-temperature.fzz diff --git a/assignments/old/read-temperature/schematic/read-temperature_bb.pdf b/assignments/old/read-temperature/schematic/read-temperature_bb.pdf Binary files differnew file mode 100644 index 0000000..79cc8eb --- /dev/null +++ b/assignments/old/read-temperature/schematic/read-temperature_bb.pdf diff --git a/assignments/old/read-temperature/schematic/read-temperature_schem.pdf b/assignments/old/read-temperature/schematic/read-temperature_schem.pdf Binary files differnew file mode 100644 index 0000000..d01ab4b --- /dev/null +++ b/assignments/old/read-temperature/schematic/read-temperature_schem.pdf diff --git a/assignments/old/read-temperature/solution/read-temperature/read-temperature.ino b/assignments/old/read-temperature/solution/read-temperature/read-temperature.ino new file mode 100644 index 0000000..b261dc5 --- /dev/null +++ b/assignments/old/read-temperature/solution/read-temperature/read-temperature.ino @@ -0,0 +1,24 @@ +#include <DHT.h> +#include <DHT_U.h> + +const auto DHTPIN = D1; +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); +} + |