From 2bf30e88ad15c12a829ac2a880f9505b133734a4 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 16 Mar 2018 12:03:59 +0000 Subject: first working sketch: looping bar --- .gitmodules | 6 ++++++ DHTesp | 1 + Makefile | 10 ++++++++++ esp8266-oled-ssd1306 | 1 + thermostat.ino | 20 ++++++++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 .gitmodules create mode 160000 DHTesp create mode 100644 Makefile create mode 160000 esp8266-oled-ssd1306 create mode 100644 thermostat.ino 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 index 0000000..643722c --- /dev/null +++ b/DHTesp @@ -0,0 +1 @@ +Subproject commit 643722c48fef78e6243089814c8544553674b488 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 index 0000000..1254ef9 --- /dev/null +++ b/esp8266-oled-ssd1306 @@ -0,0 +1 @@ +Subproject commit 1254ef967da6785f420f0895dae9228258cfb87b 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 +#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 -- cgit v1.2.3