diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-05-08 10:08:32 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-05-08 10:08:32 +0200 |
commit | 5ec40ac294aa8f092b3f70dca1cb6d103699a995 (patch) | |
tree | 36c88ba66518ba2217b8ddb1cdba80c05839a2bc /assignments/read-temperature | |
parent | 50a4f485667699d091ef8bd3cac3a73290bf0cba (diff) | |
download | iot-workshop-ndc-2018-5ec40ac294aa8f092b3f70dca1cb6d103699a995.tar.gz iot-workshop-ndc-2018-5ec40ac294aa8f092b3f70dca1cb6d103699a995.tar.bz2 iot-workshop-ndc-2018-5ec40ac294aa8f092b3f70dca1cb6d103699a995.tar.xz iot-workshop-ndc-2018-5ec40ac294aa8f092b3f70dca1cb6d103699a995.zip |
wip
Diffstat (limited to 'assignments/read-temperature')
-rw-r--r-- | assignments/read-temperature/read-temperature.md | 1 | ||||
-rw-r--r-- | assignments/read-temperature/read-temperature.pdf | bin | 791810 -> 794796 bytes | |||
-rw-r--r-- | assignments/read-temperature/solution/read-temperature/read-temperature.ino | 10 |
3 files changed, 11 insertions, 0 deletions
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 Binary files differindex 51e3c1b..f1ec641 100644 --- a/assignments/read-temperature/read-temperature.pdf +++ b/assignments/read-temperature/read-temperature.pdf 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); } |