Bon, j'ai crié victoire trop vite. Il y avait un souci sur le 3eme écran (EGT). Si je chauffais le capteur la valeur ne changeait pas.
J'ai modifié le code, ça fonctionne.... mais retour de la latence, encore pire.
Je ne comprends pas trop pourquoi.
Voilà le code "final"
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "max6675.h"
#include <Adafruit_Sensor.h>
#include <Fonts/FreeSansBold9pt7b.h>
#include <Fonts/FreeSansBold12pt7b.h>
#include <Fonts/FreeSansBold18pt7b.h>
#define SCREEN_WIDTH 128 // Largeur en pixels de l'écran OLED
#define SCREEN_HEIGHT 64 // Hauteur en pixels de l'écran OLED
// Declaration de l'écran SSD1306 connecté au I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
// EGT -----------------------------------------------------------------------------------
int convert = 0;
// Capteur température
int thermo1D0 = 4; // so
int thermo1CS = 5;
int thermo1CLK = 6; // sck
float temp1 = 0;
MAX6675 thermocouple1(thermo1CLK, thermo1CS, thermo1D0);
// Valeur max (peak)
int tempPeakReset = 50000; // Temps en millisecondes entre 2 valeurs max
float tempPeak = 0;
float tempMax = 0;
float OldtempPeak = -999;
float Oldtemp1 = -999;
unsigned long tempPeakTimer = 0;
// BOOST ----------------------------------------------------------------------------------
const int pressureInput = A0; // sélectionne la broche d'entrée analogique pour le capteur de pression
const float pressureZero = 102.4; // lecture analogique du capteur de pression à 0 psi
const float pressureMax = 921.6; // lecture analogique du capteur de pression à 100 psi
const float pressuretransducermaxPSI = 100; // Valeur max du capteur de pression (100 psi)
const unsigned long boostPeakReset = 5000; // Temps en millisecondes pour réinitialiser la valeur MAX
float boostPeak = 0; // variable pour stocker la valeur PEAK
float boostMax = 0; // variable pour stocker la valeur MAX
unsigned long boostPeakTimer = 0; //
float OldBoostPeak = -999;
float OldPressureBar = -999;
// AFR ----------------------------------------------------------------------------------
int needle = 0;
float lambda ;
float OldLambda = -999;
// Sélectionne le BUS de communication I2C -------------------------------------------------
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // Adresse du TCA9548A
Wire.write(1 << bus); // Envoie un byte au BUS sélectionné
Wire.endTransmission();
}
// 'sp_prod', 128x60px
const unsigned char epd_bitmap_sp_prod [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xf9, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0,
0x00, 0x00, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0,
0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0,
0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0,
0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80,
0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x80,
0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00,
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xe7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xcf, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xcf, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x9f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x03, 0xfe, 0x7f, 0xe3, 0xfe, 0x1f, 0xf1, 0xe1, 0xcf, 0xfc, 0xff, 0xf8, 0xff, 0x87, 0x87, 0x00,
0x07, 0x8e, 0xf0, 0xff, 0x0f, 0x38, 0x39, 0xc3, 0xdc, 0x1c, 0x3c, 0x3b, 0xc1, 0xcf, 0xce, 0x00,
0x07, 0x9e, 0xff, 0xfc, 0x07, 0x78, 0x3b, 0x87, 0xb8, 0x00, 0x38, 0x77, 0x81, 0xcf, 0xde, 0x00,
0x0f, 0xf9, 0xff, 0x9c, 0x0e, 0x70, 0x7f, 0x87, 0x38, 0x00, 0x70, 0xf7, 0x03, 0xdc, 0xfc, 0x00,
0x1e, 0x01, 0xc3, 0x9e, 0x3c, 0xf1, 0xe7, 0x8f, 0x3c, 0x78, 0x70, 0xe7, 0x87, 0x9c, 0x7c, 0x00,
0x1c, 0x03, 0x83, 0x8f, 0xf0, 0xff, 0xc3, 0xfc, 0x1f, 0xe0, 0xe1, 0xc3, 0xfe, 0x38, 0x78, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// '205', 128x60px
const unsigned char epd_bitmap_205 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x07, 0xff, 0xff, 0xff, 0xc0,
0x00, 0x01, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xff, 0xff, 0xc0,
0x00, 0x03, 0xff, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xc0,
0x00, 0x07, 0xff, 0x00, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0x80,
0x00, 0x07, 0xfc, 0x00, 0x7f, 0xe0, 0xff, 0x00, 0x00, 0x03, 0xfc, 0x0f, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x07, 0xfc, 0x00, 0x7f, 0xe0, 0xfe, 0x00, 0x00, 0x03, 0xfc, 0x1f, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0xfe, 0x00, 0x00, 0x03, 0xfc, 0x1f, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xc1, 0xfc, 0x00, 0x00, 0x07, 0xf8, 0x1f, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xff, 0xff, 0xc1, 0xfc, 0x00, 0x00, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0x83, 0xfc, 0x00, 0x00, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0x00,
0x00, 0x0f, 0xff, 0xff, 0xfe, 0x03, 0xf8, 0x00, 0x00, 0x0f, 0xf8, 0x7f, 0xe0, 0x01, 0xff, 0x00,
0x00, 0x3f, 0xff, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x0f, 0xf0, 0x7f, 0xc0, 0x00, 0xff, 0x00,
0x00, 0x3f, 0xe0, 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0xff, 0x00,
0x00, 0x7f, 0xc0, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00, 0x01, 0xfe, 0x00,
0x00, 0x7f, 0xc0, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xf0, 0xff, 0x80, 0x01, 0xfe, 0x00,
0x00, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0xff, 0x80, 0x01, 0xfe, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xfe, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xfc, 0x00,
0x00, 0xff, 0xff, 0xff, 0xfe, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xfc, 0x00,
0x00, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xf8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'tct', 128x60px
const unsigned char epd_bitmap_tct [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x80,
0x00, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xff, 0xfe, 0x00,
0x00, 0x00, 0x01, 0xff, 0x80, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00,
0x00, 0x00, 0x07, 0xfe, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00,
0x00, 0x00, 0x07, 0xfc, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00,
0x00, 0x00, 0x0f, 0xfc, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0f, 0xfc, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0f, 0xf8, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xf8, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3f, 0xf0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3f, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3f, 0xf0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// ============================================ SETUP =======================================================================================================================
void setup()
{
Wire.begin(); // Commence la communication I2C avec le Multiplexeur
// Initialise l'écran OLED 1 sur le bus numéro 2 (SCL2 - SDA2) ------------------------------------------------------------> TURBO
TCA9548A(2);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Allume l'écran
display.clearDisplay(); // Efface le buffer
display.drawBitmap(0, 0, epd_bitmap_sp_prod, 128, 60, 1); // Affiche le logo "SP Production"
display.display();
// Initialise l'écran OLED 2 sur le bus numéro 3 (SCL3 - SDA3) ------------------------------------------------------------> AFR
TCA9548A(3);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Allume l'écran
display.clearDisplay(); // Efface le buffer
display.drawBitmap(0, 0, epd_bitmap_205, 128, 60, 1); // Affiche le logo "205 Gti"
display.display ();
// Initialise l'écran OLED 3 sur le bus numéro 4 (SCL4 - SDA4) ------------------------------------------------------------> EGT
TCA9548A(4);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Allume l'écran
display.clearDisplay(); // Efface le buffer
display.drawBitmap(0, 0, epd_bitmap_tct, 128, 60, 1); // Affiche le logo "205 Gti"
display.display ();
delay(1000); // Durée affichage écran d'accueil en millisecondes
}
// ============================================ TURBO =======================================================================================================================
void mesuresTURBO()
{
// ______________ ON FAIT LES CALCULS ____________________________________________________________________________________________________
float pressureBrut = analogRead(pressureInput); // Lit la valeur de la broche d'entrée et l'affecte à la variable (0-1023)
long pressureBar1 = map(pressureBrut, 21, 900, 100, 9600); // Calcul valeur capteur pour la valeur MAX (Peak)
long barBoostAtmo = map(pressureBrut, 1023, 0, 400, 0); // Calcul valeur Boost PHASE ATMO pour la PROGRESS BAR
long barBoostTurbo = map(pressureBrut, 0, 1023, 0, 360); // Calcul valeur Boost PHASE TURBO pour la PROGRESS BAR
float pressureBar = (((pressureBrut - pressureZero) * pressuretransducermaxPSI) / (pressureMax - pressureZero) / 14); // Equation pour convertir la lecture analogique en BAR
if (boostPeak < pressureBar1 && pressureBar1 > 0.50) {
boostPeak = pressureBar1;
boostPeakTimer = millis();
if (boostMax < boostPeak) {
boostMax = boostPeak;
}
} else if (boostPeak > pressureBar1 && (millis() - boostPeakTimer) > boostPeakReset) {
boostPeak = 0.00;
}
// ______________ SI NECESSAIRE ON FAIT L'AFFICHAGE ______________________________________________________________________________________
if ((OldBoostPeak != boostPeak) || (OldPressureBar != pressureBar)) {
// on a eu un changement, on refait l'affichage
TCA9548A(2);
display.clearDisplay();
display.fillRoundRect (82, 0, 46, 19, 2, WHITE); // Rectangle blanc arrondi (Pos X, Pos Y, Largeur, Hauteur, Rayons coins, Couleur)
// Affiche la Pression MAX dans la zone blanche ------------------------------------------
display.setTextColor(BLACK); // Couleur FONT pour la valeur de pression MAX
display.setTextSize(1); // Taille FONT
display.setFont(&FreeSansBold9pt7b); // FONT 9pt
display.setCursor(95, 15); // Position "valeur MAX"
display.println(((boostPeak * 0.001) - 1.013), 1); // 1.013 = 1013 mbar Pression atmosphérique
display.setTextColor(WHITE); // Couleur FONT pour le texte "MAX"
display.setTextSize(1); // Taille FONT
display.setCursor(110, 28); // Position du texte "MAX"
display.setFont(NULL); // Font "standard"
display.print("MAX"); // Affiche le texte "MAX"
// ______________________________________________ Lecture valeur principale Pression Turbo _________________________________________________________________________________
// Valeur principale en Phase ATMOSPHERIQUE -------------------------------------------------------------------------------
if (pressureBar <= 0)
{
display.setCursor(0, 40); // Position de la valeur de DEPRESSION
display.setFont(&FreeSansBold18pt7b); // FONT 18pt
display.println(pressureBar, 1); // Affiche a valeur de DEPRESSION
display.setCursor(65, 46); // Position de l'unité (BAR)
display.setFont(&FreeSansBold9pt7b); // FONT 9pt
display.print("bar"); // Affiche l'unité "BAR"
}
// Valeur principale en Phase TURBO ---------------------------------------------------------------------------------------
else if (pressureBar > 0)
{
display.setCursor(12, 40); // Position de la valeur de PRESSION
display.setFont(&FreeSansBold18pt7b); // FONT 18pt
display.println(pressureBar, 1); // Affiche a valeur de PRESSION
display.setCursor(65, 46); // Position de l'unité (BAR)
display.setFont(&FreeSansBold9pt7b); // FONT 9pt
display.print("bar"); // Affiche l'unité "BAR"
}
// ______________________________________________ Progress bar TURBO _______________________________________________________________________________________________________
if (pressureBar < 0.2) // Si PRESSION sup. 0.2BAR --> masque la progress bar
// Cadre Progress bar -------------------------------------------------------------------------------------------------------
display.drawLine(42, 56, 42, 74, 1); // Ligne Repère 0 bar
display.drawRect(0, 56, 128, 8, WHITE); // Rectangle progress bar
// Progress bar en phase ATMO -----------------------------------------------------------------------------------------------
if (pressureBar <= 0)
{
display.fillRect(0, 58, barBoostAtmo, 4, WHITE); // (Position en x, y, VALEUR, largeur, couleur)
}
// Progress bar en phase TURBO ----------------------------------------------------------------------------------------------
if (pressureBar >= 0.1)
{
display.fillRect(45, 58, barBoostTurbo, 4, WHITE); // (Position en x, y, VALEUR, largeur, couleur)
}
// ______________________________________________ WARNING TURBO ____________________________________________________________________________________________________________
if (pressureBar >= 1.2) // Si PRESSION sup. 1.2BAR --> Affiche "WARNING"
{
display.setTextColor(BLACK);
display.setTextSize(1);
display.setCursor(20, 62);
display.setFont(&FreeSansBold9pt7b);
display.fillRect(0, 48, 128, 16, WHITE); // Affiche un rectangle blanc arrondi (Pos X, Pos Y, Largeur, Hauteur, Rayons coins, Couleur)
display.print("WARNING");
}
// ______________________________________________ Titre TURBO 88_____________________________________________________________________________________________________________
display.setTextColor(WHITE); // Couleur FONT "TURBO"
display.setTextSize(1); // Taille FONT
display.setFont(&FreeSansBold9pt7b); // FONT
display.setCursor(0, 13); // Position du texte "TURBO"
display.println("TURBO"); // Affiche le texte "TURBO"
display.display();
// ______________________________________________ On mémorise les nouvelles valeurs TURBO _________________________________________________________________________________
OldBoostPeak = boostPeak;
OldPressureBar = pressureBar;
}
}
// ============================================ AFR =========================================================================================================================
void mesuresAFR()
{
// ______________________________________________ ON FAIT LES CALCULS ___________________________________________________________________________________________________
lambda = analogRead(A1); // Affectation de la sortie A1 pour le capteur
needle = lambda;
lambda = map(lambda, 0, 1023, 74, 221); // Map pour la plage de la valeur Lambda
needle = map(needle, 0, 1023, 1, 128); // Map pour la plage du curseur
// ______________________________________________ SI NECESSAIRE ON FAIT L'AFFICHAGE ______________________________________________________________________________________
if (OldLambda != lambda)
{
// on a eu un changement, on refait l'affichage
TCA9548A(3);
display.clearDisplay();
if (lambda/10 <=9.9) // Positionnement de la valeur Lambda si UNITE seulement (permet d'avoir la valeur positionné au même endroit)
{
display.setTextSize(1);
display.setFont(&FreeSansBold18pt7b);
display.setTextColor(WHITE);
display.setCursor(48,44); // Positionne la valeur Lambda (x , y)
display.print((lambda)/10, 1); // Affiche la valeur du capteur en A1
}
else if (lambda/10 >9.9) // Positionnement de la valeur Lambda si DIZAINE + UNITE
{
display.setTextSize(1);
display.setFont(&FreeSansBold18pt7b);
display.setTextColor(WHITE);
display.setCursor(29,44); // Positionne la valeur Lambda (x , y)
display.print((lambda)/10, 1); // Affiche la valeur du capteur en A1
}
// ______________________________________________ Titre "AFR"______________________________________________________________________________________________________________
display.setTextColor(WHITE);
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(0, 12);
display.print("AFR");
// ______________________________________________ Progress BAR ____________________________________________________________________________________________________________
if ( lambda/10 < 18) // Si AFR INF. à 18 : WARNING
{
display.drawRect(0, 56, 128, 8, WHITE); // Rectangle progress bar
display.setTextColor(WHITE);
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(0, 53); // Positionne le "R" (Rche)
display.print("R");
display.setTextColor(WHITE);
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(115, 53); // Positionne le "P" (Pauvre)
display.print("P");
}
if ( lambda/10 < 18) // Si AFR INF. à 18 : WARNING
{
display.setFont(NULL);
display.drawLine(64,56,64,72,WHITE); // Barre MILIEU "14.7"
display.fillRect(2, 58, needle, 4, WHITE); // Valeur de la lambda "needle" dans la progress bar
}
// ______________________________________________ WARNING AFR _____________________________________________________________________________________________________________
else if (lambda/10 > 18) // Si AFR SUP. à 18 : WARNING
{
display.setTextColor(BLACK);
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(20, 62); // positionne le texte "WARNING"
display.fillRect(0, 49, 128, 16, WHITE); // Affiche un rectangle blanc à la place de la progress bar
display.print("WARNING");
}
// ______________________________________________ ON MEMORISE LES NOUVELLES VALEUR _______________________________________________________________________________________
OldLambda = lambda;
}
}
// ============================================ EGT =======================================================================================================================
void mesuresEGT()
{
// ______________ On fait les calculs EGT ____________________________________________________________________________________________________
temp1 = thermocouple1.readCelsius();
delay(1000);
// ______________ Si nécessaire on fait l'affichage EGT ______________________________________________________________________________________
if ((OldtempPeak != tempPeak) || (Oldtemp1 != temp1)) {
// on a eu un changement, on refait l'affichage
TCA9548A(4);
display.clearDisplay();
display.fillRoundRect (82, 0, 46, 19, 2, WHITE); // Rectangle blanc arrondi (Pos X, Pos Y, Largeur, Hauteur, Rayons coins, Couleur)
// ______________ Formule pour afficher la température max dans la zone blanche ______________________________________________________________
if (tempPeak < temp1 && temp1 > 0.50)
{
tempPeak = temp1;
tempPeakTimer = millis();
if (tempMax < tempPeak)
{
tempMax = tempPeak;
}
}
else if (tempPeak > temp1 && (millis() - tempPeakTimer) > tempPeakReset)
{
tempPeak = 0.00;
}
// Affiche la Température MAX dans la zone blanche ------------------------------------------
display.setTextColor(BLACK);
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(95, 15); // Position "valeur MAX"
display.println((tempPeak), 0); // Affiche la valeur de la température MAX
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(110, 28); // Position du texte "MAX"
display.setFont(NULL); // Retire la police précédente par la police "standard"
display.print("MAX"); // Affiche le texte "MAX"
// ______________________________________________ Lecture valeur principale EGT _________________________________________________________________________________
display.setTextSize(1);
display.setFont(&FreeSansBold18pt7b);
display.setCursor(25, 46);
display.print((temp1), 0);
// Affiche le symbole "°"
display.setTextSize(1);
display.setFont(NULL);
display.setCursor(85, 28);
display.print("o");
// Affiche l'unité de température = C
display.setTextSize(1);
display.setFont(&FreeSansBold9pt7b);
display.setCursor(90, 46);
display.setTextSize(1);
display.print("C");
// ______________________________________________ Progress bar EGT _______________________________________________________________________________________________________
if (temp1 <= 900) // Si T° sup. 900°C --> masque la progress bar
{
display.drawRect(0, 56, 128, 8, WHITE); // Rectangle progress bar
display.fillRect(2, 58, temp1 / 10, 4, WHITE); // Valeur du capteur temperature dans la Progress bar
}
// ______________________________________________ WARNING EGT ____________________________________________________________________________________________________________
if (temp1 >= 900) // Si T° sup. 900°C --> Affiche "WARNING"
{
display.setTextColor(BLACK);
display.setTextSize(1);
display.setCursor(20, 62);
display.setFont(&FreeSansBold9pt7b);
display.fillRect(0, 48, 128, 16, WHITE); // Affiche un rectangle blanc arrondi (Pos X, Pos Y, Largeur, Hauteur, Rayons coins, Couleur)
display.print("WARNING");
}
// ______________________________________________ Titre EGT _______________________________________________________________________________________________________________
display.setTextColor(WHITE); // Couleur FONT "TURBO"
display.setTextSize(1); // Taille FONT
display.setFont(&FreeSansBold9pt7b); // FONT
display.setCursor(0, 13); // Position du texte "TURBO"
display.println("EGT"); // Affiche le texte "TURBO"
display.display();
// ______________________________________________ On mémorise les nouvelles valeurs EGT _________________________________________________________________________________
OldtempPeak = tempPeak;
Oldtemp1 = temp1;
}
}
// ============================================ LOOP ========================================================================================================================
void loop() {
mesuresTURBO();
mesuresAFR();
mesuresEGT();
display.display();
}