TFT Display DollaTek ILI9341

Bei der #257 habe nur den DS gemacht nix mehr, also das oben.
Hole mall mein Test Board dort ist noch der BMP, habe kein DS18B20 frei

Wie meinst du

Das ich im den Sketch aus 257 nur die Anzeige der Temp Repariert habe was wird oben angezeigt == Out 25.5

Achso wie gesagt da wir keinen Temp gemessen die Zahlen stehen einfach nur

Bei Out wird irgend eine Zahl angezeigt ?

Ne schon gemessen aber aktualisiert sich nicht Wasser auch nicht.

Gib mall Aktuellen Sketch.
Wir Tanzen auf zwei Hochzeiten das geht nicht!
Du hast gezeigt auf Foto das die zahl Out vermischt wird das habe nur, und nur das gemacht, nix mehr.

Dein Sketch

den jetzt gerade läuft wo sich die Messwerte nicht aktualisieren

#include <DallasTemperature.h>

#include <OneWire.h>

#define ONE_WIRE_BUS 25
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

//#define AA_FONT_middle " Arimo-28" //
#define AA_FONT_Norm "Lato-Regular-28"
#include <Arduino.h>
#include <SPI.h>
#include <TFT_eSPI.h> // https://github.com/Bodmer/TFT_eSPI
TFT_eSPI tft = TFT_eSPI();

#include "SPIFFS.h"
#include "GfxUi.h"
GfxUi ui = GfxUi(&tft); // Jpeg and bmpDraw functions TODO: pull outside of a class


#include "max6675.h"

// Define the Arduino pins, the MAX6675 module is connected to
const int SO_PIN = 17;  // Serail Out (SO) pin
const int CS_PIN = 2;  // Chip Select (CS) pin
const int SCK_PIN = 14; // Clock (SCK) pin

// Create an instance of the MAX6675 class with the specified pins
MAX6675 thermocouple(14, 2, 17);

const byte thermoDO = 17; // Pins Anpassen
const byte thermoCS = 16;
const byte thermoCLK = 14;

MAX6675 thermocouple1(thermoCLK, thermoCS, thermoDO);
float max2 = 0;
void setup() {
  Serial.begin(115200);
  //delay(500);
  SPIFFS.begin();
  tft.begin();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  ui.drawJpeg("/logo.jpg", 0, 0);
  //tft.drawRect(20, 200, 251, 32, TFT_WHITE);// x y w h color
  delay(1000);
  tft.fillScreen(TFT_BLACK);
  /****** untere Symbole*****/
  tft.drawFastHLine(15, 165, 290, TFT_ORANGE); // x, y, w
  tft.drawFastVLine(165, 165, 60, TFT_ORANGE); //x, y, h
  tft.setTextColor(TFT_GREENYELLOW, TFT_BLACK);
  tft.loadFont(AA_FONT_Norm);
  tft.setCursor(10, 10  );
  tft.print("Out");
  ui.drawJpeg("/wasser_temp_2.jpg", 15, 175); // graTFT_GREENYELLOWfik, pos x, pos y
  ui.drawJpeg("/oelkanne.jpg", 170, 178);
  sensors.begin();

  sensors.setWaitForConversion(false);
  sensors.requestTemperatures();
}
void loop() {

  // Read the temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(thermocouple.readCelsius());
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");
  max2 = thermocouple1.readCelsius();
  Serial.print("Temperature: ");
  Serial.print(max2, 1);
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");


  float temp = thermocouple.readCelsius();
  //float temp = 28.3;
  //tft.setTextSize(3);
  //tft.print(temp, 1);



   tft.loadFont(AA_FONT_Norm  );
  tft.setTextPadding(tft.textWidth("55.5"));
  tft.setTextColor(TFT_BLUE, TFT_BLACK);
  //tft.setTextDatum(CL_DATUM); // Linksbündig = normal
  //tft.drawString("Ich schreibe", 20, 90); // text, x pos, y pos

  tft.setTextDatum(CR_DATUM); // Bedeutet wird Rechtsbündig geschrieben
  // damit die Zahlen nicht rumtanzen wen der Wert sich ändert
  tft.setTextColor(TFT_GREENYELLOW, TFT_BLACK);

  /****** untere Symbole*****/
  /* tft.drawFastHLine(15, 165, 290, TFT_ORANGE); // x, y, w
    tft.drawFastVLine(165, 165, 60, TFT_ORANGE); //x, y, h
    ui.drawJpeg("/wasser_temp_2.jpg", 15, 175); // grafik, pos x, pos y
    ui.drawJpeg("/zahnradsymb.jpg", 170, 175);
  */
  /***** Schreibe Temp. *******/
  tft.drawFloat(temp, 1, 140, 200);  //Wert, pos x, pos y
  tft.drawFloat(max2, 1, 300, 200);  //Wert, pos x, pos y

  /****** Formatierung zurücksetzen **********/
  
  //sensors.requestTemperatures(); // Read temperature
  float temperatureC = sensors.getTempCByIndex(0); // Get temperature in Celsius
 if (temperatureC < 0) temperatureC = 0;    // Anzeige wen DS nicht funktioniert
  
  //tft.setCursor(65, 10  );
  tft.setTextPadding(80);
  tft.setTextDatum(CR_DATUM); //

  tft.drawFloat(temperatureC, 1, 145, 20);
  tft.setTextPadding(tft.textWidth("555.5"));// String width + margin
   tft.setTextDatum(TL_DATUM); // Reset datum to normal
  tft.setTextPadding(0);      // Breite der Füllung auf keine zurücksetzen
  tft.unloadFont();

}

Wir müssen uns einigen wie und was sonst wird nix von.
Wen das Display kann auf Hochkant eingebaut werden. Ändere ich die Taktik und mache Drei Felder.

  1. Out Temp mit Symbol + temp wert +°C
    Trennlinie
  2. Wasser Symboll + temp wert +°C mit Balken darunter
    Trennlinie
  3. Öl Symbol + temp wert +°C mit Balken darunter

Somit ist genügend Platz um das alles anzeigen.

Was ist deine Meinung?

mach mall die "//" weg bei
//sensors.requestTemperatures)

und schreibe irgend wo in der void loop() das rein

Serial.print(" OUT"  =  );
Serial.println (temperatureC,1);

Mach den DS18B20 warm und schreib was wird in Serial Monitor angezeigt.

Läuft jetzt


#include <DallasTemperature.h>

#include <OneWire.h>

#define ONE_WIRE_BUS 25
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

//#define AA_FONT_middle " Arimo-28" //
#define AA_FONT_Norm "Lato-Regular-28"
#include <Arduino.h>
#include <SPI.h>
#include <TFT_eSPI.h> // https://github.com/Bodmer/TFT_eSPI
TFT_eSPI tft = TFT_eSPI();

#include "SPIFFS.h"
#include "GfxUi.h"
GfxUi ui = GfxUi(&tft); // Jpeg and bmpDraw functions TODO: pull outside of a class


#include "max6675.h"

// Define the Arduino pins, the MAX6675 module is connected to
const int SO_PIN = 17;  // Serail Out (SO) pin
const int CS_PIN = 2;  // Chip Select (CS) pin
const int SCK_PIN = 14; // Clock (SCK) pin

// Create an instance of the MAX6675 class with the specified pins
MAX6675 thermocouple(14, 2, 17);

const byte thermoDO = 17; // Pins Anpassen
const byte thermoCS = 16;
const byte thermoCLK = 14;

MAX6675 thermocouple1(thermoCLK, thermoCS, thermoDO);
float max2 = 0;
void setup() {
  Serial.begin(115200);
  //delay(500);
  SPIFFS.begin();
  tft.begin();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  ui.drawJpeg("/logo.jpg", 0, 0);
  //tft.drawRect(20, 200, 251, 32, TFT_WHITE);// x y w h color
  delay(1000);
  tft.fillScreen(TFT_BLACK);
    /****** untere Symbole*****/
  tft.drawFastHLine(15, 165, 290, TFT_ORANGE); // x, y, w
  tft.drawFastVLine(165, 165, 60, TFT_ORANGE); //x, y, h
  ui.drawJpeg("/wasser_temp_2.jpg", 15, 175); // grafik, pos x, pos y
  ui.drawJpeg("/oelkanne.jpg", 170, 178);
  sensors.begin();
}
void loop() {

  // Read the temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(thermocouple.readCelsius());
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");
  delay(500);


  max2 = thermocouple1.readCelsius();
  Serial.print("Temperature: ");
  Serial.print(max2, 1);
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");
  delay(500);


  float temp = thermocouple.readCelsius();
  //float temp = 28.3;
  //tft.setTextSize(3);
  //tft.print(temp, 1);



  tft.loadFont(AA_FONT_Norm  );
  tft.setTextPadding(tft.textWidth("555.5"));
  tft.setTextColor(TFT_BLUE, TFT_BLACK);
  //tft.setTextDatum(CL_DATUM); // Linksbündig = normal
  // tft.drawString("Ich schreibe", 20, 90); // text, x pos, y pos

  tft.setTextDatum(CR_DATUM); // Bedeutet wird Rechtsbündig geschrieben
  // damit die Zahlen nicht rumtanzen wen der Wert sich ändert
  tft.setTextColor(TFT_GREENYELLOW, TFT_BLACK);
  tft.setTextPadding(tft.textWidth("555.5"));// String width + margin

  /****** untere Symbole*****/
  /* tft.drawFastHLine(15, 165, 290, TFT_ORANGE); // x, y, w
    tft.drawFastVLine(165, 165, 60, TFT_ORANGE); //x, y, h
    ui.drawJpeg("/wasser_temp_2.jpg", 15, 175); // grafik, pos x, pos y
    ui.drawJpeg("/zahnradsymb.jpg", 170, 175);
  */
  /***** Schreibe Temp. *******/
  tft.drawFloat(temp, 1, 140, 200);  //Wert, pos x, pos y
  tft.drawFloat(max2, 1, 300, 200);  //Wert, pos x, pos y

  /****** Formatierung zurücksetzen **********/

 
  
  sensors.requestTemperatures(); // Read temperature
  float temperatureC = sensors.getTempCByIndex(0); // Get temperature in Celsius
 if (temperatureC < 0) temperatureC = 0;    // Anzeige wen DS nicht funktioniert
  
  //tft.setCursor(65, 10  );
  tft.setTextPadding(80);
  tft.setTextDatum(CR_DATUM); //

  tft.drawFloat(temperatureC, 1, 145, 20);
  tft.setTextPadding(tft.textWidth("555.5"));// String width + margin
   tft.setTextDatum(TL_DATUM); // Reset datum to normal
  tft.setTextPadding(0);      // Breite der Füllung auf keine zurücksetzen
  tft.unloadFont();

}

Na ja so ist das wenn man nicht direkt testen kann.
Ist die Temp anzeige schnell genug oder Stottert die ?

Ist gut sonst springt die immer hin und her

So habe ich mir das etwa vorgestellt. Oder meinst du das sieht nicht gut aus?
bei deiner Version gibt es dann Probleme mit dem Logo oder?

Ich bin der Meinung das ein Logo sollte immer die Proportion des Original haben. auch wen "Trauerrände" auf dem Display sind. Ein auseinander gezogenes oder gequetschtes Logo finde nicht so schön, wie wurde zB. ein Mercedes Symbol oder VW als Ei aussehen, wurde sagen inakzeptabel :wink:

Also hochkant kein Problem?

Für mich ist das egal die Balken habe so gemacht das die ohne Probleme anpassen kann.
Was ich bei der TFT_eSPI schade finde das Bodmer hat keine Abfrage der Display werte eingebaut dann wurde automatische Anpassung auf größeren Display kein Problem.
Na ja man muss nehmen wie es ist :wink:
Heute wahrscheinlich nicht, aber baue was zusammen damit man sieht wie das wurde sein.
Bitte sende mir dein data Ordner als zip, logo brauch nicht, damit man mit den gleichen Symbolen arbeitet.

oelkanne
wasser_temp_2

OK die habe ich auch, mall schauen was wird. :wink:
Erstmal ohne jeglicher Auswertung damit Du kannst ein Überblick haben.
Gute Nacht :wink: