From 7d6fe95ff9926841fdea31105d9f1a7d8650aeec Mon Sep 17 00:00:00 2001 From: -help Date: Sun, 28 Jan 2024 00:47:26 +0200 Subject: [PATCH] Added In VOltage to OLED Reflow stage (Important because it shows if your Power supply is not giving enogh voltage) --- src/displays/oled.cpp | 4 ++-- src/displays/tft.cpp | 11 +++++++++++ src/displays/tft.h | 21 +++++++++++++++++++++ src/globals.h | 3 +-- src/leds/leds.h | 10 ++++++---- src/main.cpp | 2 ++ 6 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 src/displays/tft.cpp create mode 100644 src/displays/tft.h diff --git a/src/displays/oled.cpp b/src/displays/oled.cpp index f2c06d3..2905b2d 100644 --- a/src/displays/oled.cpp +++ b/src/displays/oled.cpp @@ -287,9 +287,9 @@ void OledDisplay::handleReflowState() centerText(("Target: " + String(targetTemp)).c_str(), DisplayTextAlignment::END, DisplayTextAlignment::END); display.setTextSize(1, 1); - display.setCursor(25, 40); + display.setCursor(15, 16); float systemVoltage = analogRef.calculateInputVoltage(); - display.println("In:"+String(systemVoltage)); + display.println("In Voltage:"+String(systemVoltage)); display.display(); } diff --git a/src/displays/tft.cpp b/src/displays/tft.cpp new file mode 100644 index 0000000..ae1b061 --- /dev/null +++ b/src/displays/tft.cpp @@ -0,0 +1,11 @@ +#include "tft.h" + +extern Adafruit_ST7789 tft; + +TFT::TFT() +{ +} + +TFT::~TFT() +{ +} diff --git a/src/displays/tft.h b/src/displays/tft.h new file mode 100644 index 0000000..513271d --- /dev/null +++ b/src/displays/tft.h @@ -0,0 +1,21 @@ +#ifndef TFT_H +#define TFT_H + +#include +#include // Include the ST7789 library + +class TFT { +public: + TFT(); + ~TFT(); + + // Add your class methods here + void clear(); + + +private: + // Add your private members here + +}; + +#endif // TFT_H diff --git a/src/globals.h b/src/globals.h index 277caef..dc946d5 100644 --- a/src/globals.h +++ b/src/globals.h @@ -6,8 +6,7 @@ #include "./EEPROMDataManager.h" #include "./PID/PidController.h" -//Comment out to disable debug messages - +//Comment out to enable debug messages //#define DEBUG //For printing debug messages diff --git a/src/leds/leds.h b/src/leds/leds.h index 92ade03..aa34033 100644 --- a/src/leds/leds.h +++ b/src/leds/leds.h @@ -4,11 +4,13 @@ #include "../common.h" #include "../globals.h" -// If you didnt solder the LEDS in order, change the order here -#define LEFT_LED_PIN 20 -#define MID_LED_PIN 18 -#define RIGHT_LED_PIN 19 +// If you didnt solder the LEDS in order, change the order here just change the pin numbers till it matches your board +#define LEFT_LED_PIN 20 //Should be RED +#define MID_LED_PIN 18 //Should be YELLOW +#define RIGHT_LED_PIN 19 //Should be GREEN #define GREEN_LED_PIN RIGHT_LED_PIN + + enum LedDesiredState { LED_ON, diff --git a/src/main.cpp b/src/main.cpp index 18c9daa..1ddc80a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,8 @@ // Create an instance of the Adafruit ST7789 class using the custom SPI pins Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST); + + #define MOSTFET_PIN 17 double currentTemp = 0;