Bonjour,
J'ai un LCD avec un module I2C. Un jour mon programme fonctionnait nickel sans aucuns soucis, et d'un jour à l'autre, plus rien... Et beaucoup de message d'erreur ! Donc je voulais savoir si quelqu'un pourrait me donner un coup de main pour trouver la solution...
Mon Code :
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
//#include <SPI.h>
//#include <LCD.h>
#define I2C_ADDR 0x27 // <<—– Mettre adresse
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
int flag = 0;
char entree = 0; // Entrée série
int dispo = 0; // Nombre de caractère
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup()
{
Serial.begin(9600);
lcd.begin (20,4); // Taille affichage colonne, ligne
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
lcd.setBacklight(HIGH); // Allumage ou non
lcd.home(); // go home
lcd.clear();
}
void loop()
{
dispo = Serial.available();
if(dispo != 0)
{
Serial.print("\n");
lcd.clear();
}
while(dispo > 0)
{
entree = Serial.read();
Serial.print(entree);
lcd.print(entree);
dispo = Serial.available();
}
}
Mes erreurs :
LCD_I2C:21: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
^
C:\Users\lievale.DIVTEC\Desktop\Dossier\Arduino\LCD_I2C\LCD_I2C.ino:21:81: note: candidates are:
In file included from C:\Users\lievale.DIVTEC\Desktop\Dossier\Arduino\LCD_I2C\LCD_I2C.ino:1:0:
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:3: note: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);
^
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:3: note: candidate expects 3 arguments, 8 provided
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:56:7: note: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)
class LiquidCrystal_I2C : public Print {
^
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:56:7: note: candidate expects 1 argument, 8 provided
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:56:7: note: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)
C:\Users\lievale.DIVTEC\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:56:7: note: candidate expects 1 argument, 8 provided
C:\Users\lievale.DIVTEC\Desktop\Dossier\Arduino\LCD_I2C\LCD_I2C.ino: In function 'void setup()':
LCD_I2C:27: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
^
LCD_I2C:27: error: 'POSITIVE' was not declared in this scope
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
^
exit status 1
no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'
Voilà en espérant que quelqu'un puisse m'aidé
A+