Here is the code formatted better and in code tags
#include <Adafruit_GFX.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>
#include <Adafruit_SSD1306.h>
#include <SPI.h>
#include <Wire.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
int counter = 0;
int infofil = 0;
int infobuse = 0;
int infolit = 0;
void setup()
{
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop()
{
display.setTextSize(1);
display.setTextColor(WHITE);
while (1)
{
if (infofil = 0);
display.setCursor(0, 0);
display.println("DETECTION DU FIL=OUI");
display.display();
if (infofil != 0)
display.setCursor(0, 0);
display.println("DETECTION DU FIL=NON");
display.display();
infolit = Serial.read();
display.setCursor(0, 1);
display.println("TEMPERATURE LIT CHAUFFANT=", infolit);
display.display();
infobuse = Serial.read();
display.setCursor(0, 2);
display.println("TEMPERATURE BUSE=" infobuse);
display.display();
}
}
Let's start with the easy stuff
if (infofil = 0);
This line of code sets infofil to 0 rather than testing whether it is zero.
Even if you used == instead of = to turn it into a test then the only code depending on its value being zero is the semicolon. I am sure that is not what you meant to happen.
Which lines of code should be executed if infofil is equal to zero ?
How much do you know about programming in C ?
Have you looked at and tried the examples in the IDE ?