Added In VOltage to OLED Reflow stage (Important because it shows if your Power supply is not giving enogh voltage)

This commit is contained in:
-help 2024-01-28 00:47:26 +02:00
parent 9a1f595bb5
commit 7d6fe95ff9
6 changed files with 43 additions and 8 deletions

View File

@ -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();
}

11
src/displays/tft.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "tft.h"
extern Adafruit_ST7789 tft;
TFT::TFT()
{
}
TFT::~TFT()
{
}

21
src/displays/tft.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef TFT_H
#define TFT_H
#include <Arduino.h>
#include <Adafruit_ST7789.h> // 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

View File

@ -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

View File

@ -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,

View File

@ -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;