summaryrefslogtreecommitdiff
path: root/thermostat.ino
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-03-23 13:27:49 +0000
committerdakkar <dakkar@thenautilus.net>2018-03-23 13:27:49 +0000
commit09523acd17940e512c47a01066c530fddb15baad (patch)
tree12f3efb9c8921aeb3ce3aa1bd5a18771b9d85c40 /thermostat.ino
parentkill useless line (diff)
downloadthermostat-09523acd17940e512c47a01066c530fddb15baad.tar.gz
thermostat-09523acd17940e512c47a01066c530fddb15baad.tar.bz2
thermostat-09523acd17940e512c47a01066c530fddb15baad.zip
move into subdir
Diffstat (limited to 'thermostat.ino')
-rw-r--r--thermostat.ino36
1 files changed, 0 insertions, 36 deletions
diff --git a/thermostat.ino b/thermostat.ino
deleted file mode 100644
index 63f87f0..0000000
--- a/thermostat.ino
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <Wire.h>
-#include "SSD1306.h"
-#include "DHTesp.h"
-
-SSD1306 display(0x3c, 5, 4);
-DHTesp dht;
-
-void setup() {
- dht.setup(13,DHTesp::AUTO_DETECT);
-
- display.init();
- display.connect();
- display.displayOn();
-}
-
-void loop() {
- delay(dht.getMinimumSamplingPeriod());
- float humidity = dht.getHumidity();
- float temperature = dht.getTemperature();
-
- if (dht.getStatus() == DHTesp::ERROR_TIMEOUT) return;
-
- display.clear();
-
- String line;
- line = "T:"; line += temperature;
- display.drawString(0,0,line);
- line = "H:"; line += humidity;
- display.drawString(50,0,line);
- display.drawString(0,10,dht.getStatusString());
-
- display.drawProgressBar(5,25,120,10,int(temperature));
- display.drawProgressBar(5,40,120,10,int(humidity));
-
- display.display();
-}