From 09523acd17940e512c47a01066c530fddb15baad Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 23 Mar 2018 13:27:49 +0000 Subject: move into subdir --- .gitmodules | 4 ++-- DHTesp | 1 - Makefile | 10 ---------- README.rst.txt | 8 -------- esp8266-oled-ssd1306 | 1 - sensor/DHTesp | 1 + sensor/Makefile | 10 ++++++++++ sensor/README.rst.txt | 8 ++++++++ sensor/esp8266-oled-ssd1306 | 1 + sensor/thermostat.ino | 36 ++++++++++++++++++++++++++++++++++++ thermostat.ino | 36 ------------------------------------ 11 files changed, 58 insertions(+), 58 deletions(-) delete mode 160000 DHTesp delete mode 100644 Makefile delete mode 100644 README.rst.txt delete mode 160000 esp8266-oled-ssd1306 create mode 160000 sensor/DHTesp create mode 100644 sensor/Makefile create mode 100644 sensor/README.rst.txt create mode 160000 sensor/esp8266-oled-ssd1306 create mode 100644 sensor/thermostat.ino delete mode 100644 thermostat.ino diff --git a/.gitmodules b/.gitmodules index 7bfb0bf..6cb91dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "DHTesp"] - path = DHTesp + path = sensor/DHTesp url = https://github.com/beegee-tokyo/DHTesp [submodule "esp8266-oled-ssd1306"] - path = esp8266-oled-ssd1306 + path = sensor/esp8266-oled-ssd1306 url = https://github.com/ThingPulse/esp8266-oled-ssd1306 diff --git a/DHTesp b/DHTesp deleted file mode 160000 index 643722c..0000000 --- a/DHTesp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 643722c48fef78e6243089814c8544553674b488 diff --git a/Makefile b/Makefile deleted file mode 100644 index 68ba91f..0000000 --- a/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -SKETCH = thermostat.ino -CUSTOM_LIBS = DHTesp esp8266-oled-ssd1306 - -UPLOAD_PORT = /dev/ttyUSB0 -BOARD = lolin32 - -ESP_ROOT = $(HOME)/Arduino/hardware/espressif/esp32/ -CHIP = esp32 - -include $(HOME)/src/makeEspArduino/makeEspArduino.mk diff --git a/README.rst.txt b/README.rst.txt deleted file mode 100644 index f97de5c..0000000 --- a/README.rst.txt +++ /dev/null @@ -1,8 +0,0 @@ -Some links: - -* links to some ESP32 libraries - https://www.arduinolibraries.info/architectures/esp32 -* the OLED library https://github.com/ThingPulse/esp8266-oled-ssd1306 -* vague guide to the OLED library - https://diyprojects.io/using-i2c-128x64-0-96-ssd1306-oled-display-arduino/ -* the sensor library https://github.com/beegee-tokyo/DHTesp diff --git a/esp8266-oled-ssd1306 b/esp8266-oled-ssd1306 deleted file mode 160000 index 1254ef9..0000000 --- a/esp8266-oled-ssd1306 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1254ef967da6785f420f0895dae9228258cfb87b diff --git a/sensor/DHTesp b/sensor/DHTesp new file mode 160000 index 0000000..643722c --- /dev/null +++ b/sensor/DHTesp @@ -0,0 +1 @@ +Subproject commit 643722c48fef78e6243089814c8544553674b488 diff --git a/sensor/Makefile b/sensor/Makefile new file mode 100644 index 0000000..68ba91f --- /dev/null +++ b/sensor/Makefile @@ -0,0 +1,10 @@ +SKETCH = thermostat.ino +CUSTOM_LIBS = DHTesp esp8266-oled-ssd1306 + +UPLOAD_PORT = /dev/ttyUSB0 +BOARD = lolin32 + +ESP_ROOT = $(HOME)/Arduino/hardware/espressif/esp32/ +CHIP = esp32 + +include $(HOME)/src/makeEspArduino/makeEspArduino.mk diff --git a/sensor/README.rst.txt b/sensor/README.rst.txt new file mode 100644 index 0000000..f97de5c --- /dev/null +++ b/sensor/README.rst.txt @@ -0,0 +1,8 @@ +Some links: + +* links to some ESP32 libraries + https://www.arduinolibraries.info/architectures/esp32 +* the OLED library https://github.com/ThingPulse/esp8266-oled-ssd1306 +* vague guide to the OLED library + https://diyprojects.io/using-i2c-128x64-0-96-ssd1306-oled-display-arduino/ +* the sensor library https://github.com/beegee-tokyo/DHTesp diff --git a/sensor/esp8266-oled-ssd1306 b/sensor/esp8266-oled-ssd1306 new file mode 160000 index 0000000..1254ef9 --- /dev/null +++ b/sensor/esp8266-oled-ssd1306 @@ -0,0 +1 @@ +Subproject commit 1254ef967da6785f420f0895dae9228258cfb87b diff --git a/sensor/thermostat.ino b/sensor/thermostat.ino new file mode 100644 index 0000000..63f87f0 --- /dev/null +++ b/sensor/thermostat.ino @@ -0,0 +1,36 @@ +#include +#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(); +} 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 -#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(); -} -- cgit v1.2.3