diff options
author | dakkar <dakkar@thenautilus.net> | 2018-03-16 12:03:59 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-03-16 12:03:59 +0000 |
commit | 2bf30e88ad15c12a829ac2a880f9505b133734a4 (patch) | |
tree | 8945debb6d05302f0ea4bbc61195879d1e0d7f4d | |
download | thermostat-2bf30e88ad15c12a829ac2a880f9505b133734a4.tar.gz thermostat-2bf30e88ad15c12a829ac2a880f9505b133734a4.tar.bz2 thermostat-2bf30e88ad15c12a829ac2a880f9505b133734a4.zip |
first working sketch: looping bar
-rw-r--r-- | .gitmodules | 6 | ||||
m--------- | DHTesp | 0 | ||||
-rw-r--r-- | Makefile | 10 | ||||
m--------- | esp8266-oled-ssd1306 | 0 | ||||
-rw-r--r-- | thermostat.ino | 20 |
5 files changed, 36 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7bfb0bf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "DHTesp"] + path = DHTesp + url = https://github.com/beegee-tokyo/DHTesp +[submodule "esp8266-oled-ssd1306"] + path = esp8266-oled-ssd1306 + url = https://github.com/ThingPulse/esp8266-oled-ssd1306 diff --git a/DHTesp b/DHTesp new file mode 160000 +Subproject 643722c48fef78e6243089814c8544553674b48 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..68ba91f --- /dev/null +++ b/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/esp8266-oled-ssd1306 b/esp8266-oled-ssd1306 new file mode 160000 +Subproject 1254ef967da6785f420f0895dae9228258cfb87 diff --git a/thermostat.ino b/thermostat.ino new file mode 100644 index 0000000..06b1769 --- /dev/null +++ b/thermostat.ino @@ -0,0 +1,20 @@ +#include <Wire.h> +#include "SSD1306.h" + +SSD1306 display(0x3c, 5, 4); + +void setup() { + display.init(); + display.connect(); + display.displayOn(); + display.setColor(WHITE); + display.setTextAlignment(TEXT_ALIGN_CENTER); +} + +int pos=0; +void loop() { + display.clear(); + display.drawProgressBar(5,5,120,20,pos); + display.display(); + ++pos;pos %= 100; +}
\ No newline at end of file |