fix: touch and update constants

This commit is contained in:
2021-11-17 17:23:31 +01:00
parent 87899316b1
commit d33566ad16
6 changed files with 35 additions and 38 deletions

View File

@@ -19,11 +19,11 @@ FT6206::FT6206() { touches = 0; }
/**************************************************************************/
// bool begin(uint8_t thresh = FT62XX_DEFAULT_THRESHOLD, uint16_t width, uint16_t height, bool flip );
bool FT6206::begin(uint16_t width, uint16_t height, bool flip, uint8_t thresh) {
Wire.begin();
bool FT6206::begin(uint8_t sda, uint8_t scl, uint16_t width, uint16_t height, bool flip, uint8_t thresh) {
Wire.begin(sda, scl);
_width = width;
_height = height;
_flip = flip;
_flip = flip;
#ifdef FT6206_DEBUG
Serial.print("Vend ID: 0x");
Serial.println(readRegister8(FT62XX_REG_VENDID), HEX);

View File

@@ -56,7 +56,7 @@ public:
class FT6206 {
public:
FT6206(void);
bool begin(uint16_t width, uint16_t height, bool flip = false, uint8_t thresh = FT62XX_DEFAULT_THRESHOLD);
bool begin(uint8_t sda, uint8_t scl, uint16_t width, uint16_t height, bool flip = false, uint8_t thresh = FT62XX_DEFAULT_THRESHOLD);
uint8_t touched(void);
TS_Point getPoint(uint8_t n = 0);

View File

@@ -215,7 +215,7 @@ String getReflowState_str(void)
return String("Completed");
break;
case REFLOW_STATE_TOO_HOT:
return String("OVERHEATING!");
return String("HOT!");
break;
case REFLOW_STATE_ERROR:
return String("Error");
@@ -582,7 +582,7 @@ void handleControlLoop()
Serial.println("handlecontrolloop: ERROR state");
return;
}
getSafetyCheck();
//getSafetyCheck();
handleTemperatureReadings();
handleReflowStatemachine();
handleReflowPID();

View File

@@ -3,37 +3,35 @@
#include "Arduino.h"
// ***** CONSTANTS *****
#define TEMPERATURE_ROOM 50
#define TEMPERATURE_SOAK_MIN 150
#define TEMPERATURE_SOAK_MAX 185
#define TEMPERATURE_REFLOW_MAX 220
#define TEMPERATURE_COOL_MIN 100
#define TEMPERATURE_ROOM 75
#define SENSOR_SAMPLING_TIME 1000
#define SOAK_TEMPERATURE_STEP 5
#define SOAK_MICRO_PERIOD 9000
#define DEBOUNCE_PERIOD_MIN 50
#define PREHEAT_PERIOD 12000
#define REFLOW_PERIOD 12000
#define COOLDOWN_PERIOD 30000
// ***** PID PARAMETERS *****
// ***** PARAMETERS *****
// ***** PRE-HEAT STAGE *****
#define PID_KP_PREHEAT 100
#define PID_KI_PREHEAT 0.025
#define PID_KD_PREHEAT 20
#define PREHEAT_PERIOD 20000
// ***** SOAKING STAGE *****
#define PID_KP_SOAK 300
#define PID_KI_SOAK 0.05
#define PID_KD_SOAK 250
#define TEMPERATURE_SOAK_MIN 150
#define TEMPERATURE_SOAK_MAX 185
#define SOAK_TEMPERATURE_STEP 5
#define SOAK_MICRO_PERIOD 9000
// ***** REFLOW STAGE *****
#define PID_KP_REFLOW 300
#define PID_KI_REFLOW 0.05
#define PID_KD_REFLOW 350
#define TEMPERATURE_REFLOW_MAX 220
#define REFLOW_PERIOD 30000
// ***** COOLING STAGE *****
#define COOLDOWN_PERIOD 180000
#define TEMPERATURE_COOL_MIN 100
//PID settings
#define PID_SAMPLE_TIME 1000
// This is for testing on different board
// #define LCD_PIN 14
// #define ODROID
// ***** TYPE DEFINITIONS *****
typedef enum REFLOW_STATE

View File

@@ -358,7 +358,7 @@ void updateGUIButtons(void)
void initTouchScreen(void)
{
//ts.begin();
if (!ts.begin(tft.width(), tft.height(), true, 40))
if (!ts.begin(TOUCH_SDA, TOUCH_SCL, tft.width(), tft.height(), true, 40))
{
Serial.println("Unable to start touchscreen.");
}

View File

@@ -28,7 +28,7 @@
#define CHART_H 200
#define CHART_FONT 1
#define CHART_TIME_MAX 140 //time scale in seconds
#define CHART_TIME_MAX 500 //time scale in seconds
#define CHART_TEMP_MIN 20 //offset in degrees
#define CHART_TEMP_MAX 240 //degrees
#define CHART_Y_TICKS 10
@@ -39,7 +39,6 @@
#define CHART_ACTUAL_COLOR TFT_RED
#define CHART_BG_COLOR TFT_BLACK
#define STATE_X 0
#define STATE_Y 13
#define STATE_W TFT_WIDTH