diff options
| -rw-r--r-- | include/config.h | 19 | ||||
| -rw-r--r-- | platformio.ini | 10 | ||||
| -rw-r--r-- | src/main.c | 12 | ||||
| -rw-r--r-- | src/main.cpp | 55 |
4 files changed, 72 insertions, 24 deletions
diff --git a/include/config.h b/include/config.h index 5e54654..2ff211f 100644 --- a/include/config.h +++ b/include/config.h @@ -1,14 +1,17 @@ #ifndef CONFIG_H #define CONFIG_H -#define PWM 13 +#define TFT_CS 37 +#define TFT_DC 36 +#define TFT_RST 35 +#define TFT_MOSI 34 +#define TFT_SCLK 33 -#define LED_SCL 33 -#define LED_SDA 34 -#define LED_RES 35 -#define LED_DC 36 -#define LED_CS 37 +#define SERVO_PIN 13 -#define DS_DATA 39 +#define BUTTON_UP 3 +#define BUTTON_DOWN 5 +#define BUTTON_CONFIRM 7 +#define BUTTON_EXIT 9 -#endif
\ No newline at end of file +#endif diff --git a/platformio.ini b/platformio.ini index fd9313e..f334e0c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,8 +16,10 @@ lib_deps = adafruit/Adafruit GFX Library@^1.12.0 adafruit/Adafruit SSD1306@^2.5.13 mbed-aluqard/arduino@0.0.0+sha.3b83fc30bbdf - - + mbed-cognoscan/Adafruit_ST7735@0.0.0+sha.20134e1718b2 + adafruit/Adafruit ST7735 and ST7789 Library@^1.11.0 + madhephaestus/ESP32Servo @ ^3.0.5 + arduinogetstarted/ezButton@^1.0.6 build_flags = - -Iinclude - -D ARDUINO_USB_CDC_ON_BOOT=1 + -Iinclude + -D ARDUINO_USB_CDC_ON_BOOT=1 diff --git a/src/main.c b/src/main.c deleted file mode 100644 index 925a112..0000000 --- a/src/main.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <Arduino.h> - -// #include <settings.h> -// -void setup() { - Serial.begin(115200); -} - -void loop() { - Serial.println("hello"); - delay(1000); -} diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d1e1b4d --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,55 @@ +#include <Arduino.h> + +#include "config.h" + +#include <Adafruit_GFX.h> +#include <Adafruit_ST7789.h> +#include <SPI.h> +#include <ESP32Servo.h> +#include <ezButton.h> + + +Adafruit_ST7789 tft = Adafruit_ST7789(&SPI, TFT_CS, TFT_DC, TFT_RST); +Servo myServo; + +float temp_internal; +float temp_external; + +void setupDisplay(){ + + SPI.begin(TFT_SCLK, -1, TFT_MOSI, TFT_CS); + tft.init(240, 240); + tft.fillScreen(ST77XX_BLACK); + + tft.setTextColor(ST77XX_CYAN); + tft.setTextSize(3); + + tft.setCursor(0, 0); + tft.print("TEMP INTERNAL"); + tft.setCursor(0, 25); + tft.print("min: 50,5"); + tft.setCursor(0, 50); + tft.print("cur: 67,1"); + + tft.setCursor(0, 90); + tft.print("TEMP EXTERNAL"); + tft.setCursor(0, 115); + tft.print("max: 90,0"); + tft.setCursor(0, 140); + tft.print("cur: 80,5"); + + tft.setCursor(0, 180); + tft.print("HISTEREZA"); + tft.setCursor(0, 205); + tft.print("5"); +} + + +void setup() { + Serial.begin(115200); + delay(100); + setupDisplay(); +} + +void loop() { +} |