0

Im not really sure what causes the following problem and i wasn't able to find anything online that helped me so far.

stacktrace

1

Main.cpp

The only really important out of the Main.cpp for this is

void setup() {
  Serial.begin(115200);
  controller.connectToWiFi();
}

Complete Main.cpp

#include <Arduino.h>
#include <MCUFRIEND_kbv.h>
#include <TouchScreen.h>
#include <EEPROM.h>
#include <iostream>
#include "Controller.cpp"

#define LCD_RD  2
#define LCD_WR  4
#define LCD_RS 15
#define LCD_CS 33
#define LCD_RST 32

#define LCD_D0 12
#define LCD_D1 13
#define LCD_D2 26
#define LCD_D3 25
#define LCD_D4 17
#define LCD_D5 16
#define LCD_D6 27
#define LCD_D7 14

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

int XP=LCD_D6, XM=LCD_RS, YP=LCD_WR, YM=LCD_D7;
const int LEFT=-2500,RIGHT=600,TOP=687,BOT=-2200; // still needs to be calibrated

int mappedX, mappedY;

bool enableDebugLogging = true;

TouchScreen touchScreen = TouchScreen(XP, YP, XM, YM, 300);
TSPoint touchScreenPoint;
MCUFRIEND_kbv tft;
Controller controller;
int cursorStart = 0;
String message = "Hallo wie gehts";

void initializeTFTScreen() {
  tft.reset();
  tft.begin(tft.readID());
  tft.setRotation(1);
}

void mapTouchScreenPoints() {
  touchScreenPoint = touchScreen.getPoint();
  mappedX = map(touchScreenPoint.x, LEFT, RIGHT, 0, tft.width());
  mappedY = map(touchScreenPoint.y, TOP, BOT, 0, tft.height());
}

void printStringOnDisplay(const String &string, int x, int y) {
  int16_t x1, y1;
  uint16_t w, h;

  tft.fillScreen(BLACK);

  tft.getTextBounds(string, x, y, &x1, &y1, &w, &h);

  cursorStart = x-w/2;
  tft.setCursor(cursorStart, y - h / 2);

  tft.print(string);
}

void calibrateTouchScreen() {
  mapTouchScreenPoints();
  Serial.println("-----------------------");
  Serial.println("X: " + String(touchScreenPoint.x));
  Serial.println("Y: " + String(touchScreenPoint.y));
  Serial.println("mapped X: " + String(mappedX));
  Serial.println("mapped Y: " + String(mappedY));
}

void debugLog(String logEntry) {
  if (enableDebugLogging) {
    Serial.println(logEntry);
  }
}

void debugLog(int logEntry) {
  debugLog(String(logEntry));
}

void setup() {
  Serial.begin(115200);
  controller.connectToWiFi();
}

void loop() {
  
}

Controller.cpp

#include <WebServer.h>
#include "Credentials.cpp"

Credentials::WlanCredentials wlan;
WebServer server(80);

class Controller {
    public:

        void connectToWiFi() {
            WiFi.begin(wlan.SSID, wlan.PASSWORD);
            Serial.println("Connecting ");
            while(WiFi.status() != WL_CONNECTED) {}
            Serial.println("Connected!");
            Serial.println("Local IP: " + WiFi.localIP());
        }

        void startWebServer() {

        }

};

Credentials.cpp

namespace Credentials {
    class WlanCredentials {
        public:
            const char* SSID = "*";
            const char* PASSWORD = "*";
    };
}

What i already tried was moving the WiFi package into lib_deps but without deleting the .pio directory because i need it for other dependencies link to the post where i got this as a possible solution

based on this post i also tried to delete C:\Users\Name.platformio\packages\toolchain-xtensa-esp32 and the I also tried to delete C:\Users\Name.platformio\packages\toolchain-xtensa

vimuth
  • 5,064
  • 33
  • 79
  • 116
Cohron
  • 1
  • 1

0 Answers0