Aide compatibilité librairie

J'ai un petit problème, si quelqu'un pourait m'aider. Je compile ce programe :

#include <Keypad.h>
#include <Password.h>
#include <Wire.h>
#include "RTClib.h"
#include <Deuligne.h>
#include <SD.h>
#include <GSM.h>

RTC_Millis RTC;
GSM gsmAccess;
GSM_SMS sms;
DateTime now = RTC.now();
Deuligne lcd;
Password password = Password( "1234" );
File myFile;

const int chipSelect = 53;
int LEDVerte = 22;
int LEDRouge = 24;
int NBIntrusions = 0;
int STOPINTRU = 0;
int Button = 2;
int ButtonState = 0;

const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {28,30,32,34};
byte colPins[COLS] = {36,38,40};
 
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup () {
    RTC.begin(DateTime(__DATE__, __TIME__));
    
    lcd.init();
    
    pinMode (LEDVerte,OUTPUT);
    pinMode (LEDRouge,OUTPUT);
    pinMode(Button, INPUT);
    ButtonState = digitalRead(Button);
 
    lcd.print("Initializing SD card...");
    delay(2450);
    lcd.clear();
        
    if (!SD.begin(chipSelect)) {
    lcd.print("Card failed, or not present");
    return;
  }
  lcd.print("Card initialized.");
  delay(2450);
  lcd.clear();
  
    myFile = SD.open("journal.txt", FILE_WRITE);
    keypad.addEventListener(keypadEvent);

}

void loop () {
       
    keypad.getKey();}

void time(){
  
    lcd.backLight(false);
    lcd.setCursor(0,0);
    lcd.print(now.day(), DEC);
    lcd.print('/');
    lcd.print(now.month(), DEC);
    lcd.print('/');
    lcd.print(now.year(), DEC);
    lcd.setCursor(0,1);
    lcd.print(now.hour(), DEC);
    lcd.print(':');
    lcd.print(now.minute(), DEC);
    lcd.print(':');
    lcd.print(now.second(), DEC);}


void keypadEvent(KeypadEvent eKey){
  switch (keypad.getState()){
    case PRESSED:
	switch (eKey){
	  case '*': checkPassword(); break;
                    myFile.print (now.day(), DEC);
                    myFile.print ('/');
                    myFile.print (now.month(), DEC);
                    myFile.print ('/');
                    myFile.print (now.year(), DEC);
                    myFile.print (" à ");
                    myFile.print (now.hour(), DEC);
                    myFile.print (':');
                    myFile.print (now.minute(), DEC);
                    myFile.print (':');
                    myFile.print (now.second(), DEC);
                    myFile.print ("    Vérification mot de passe ...");

	  case '#': password.reset(); break;
                    myFile.print (now.day(), DEC);
                    myFile.print ('/');
                    myFile.print (now.month(), DEC);
                    myFile.print ('/');
                    myFile.print (now.year(), DEC);
                    myFile.print (" à ");
                    myFile.print (now.hour(), DEC);
                    myFile.print (':');
                    myFile.print (now.minute(), DEC);
                    myFile.print (':');
                    myFile.print (now.second(), DEC);
                    myFile.print ("    Annulation de la saisie en cours");

          default: password.append(eKey);}}}
          
void checkPassword(){

  if (password.evaluate()){
    STOPINTRU = 0;
    lcd.clear();
    lcd.backLight(true);
    lcd.print("Mot de Passe :");
    lcd.setCursor(0,1);
    lcd.print("OK");
    digitalWrite (LEDVerte,HIGH);
    delay (2450);
    lcd.clear();
    lcd.print("Intrusions :");
    lcd.setCursor(0,1);
    lcd.print(NBIntrusions);
    delay (2450);
    lcd.clear();
    lcd.backLight(false);
    digitalWrite (LEDVerte,LOW);
    password.reset();
    myFile.print (now.day(), DEC);
    myFile.print ('/');
    myFile.print (now.month(), DEC);
    myFile.print ('/');
    myFile.print (now.year(), DEC);
    myFile.print (" à ");
    myFile.print (now.hour(), DEC);
    myFile.print (':');
    myFile.print (now.minute(), DEC);
    myFile.print (':');
    myFile.print (now.second(), DEC);
    myFile.print ("    Mot de Passe juste entré");

if (ButtonState == HIGH) {
    myFile.print (now.day(), DEC);
    myFile.print ('/');
    myFile.print (now.month(), DEC);
    myFile.print ('/');
    myFile.print (now.year(), DEC);
    myFile.print (" à ");
    myFile.print (now.hour(), DEC);
    myFile.print (':');
    myFile.print (now.minute(), DEC);
    myFile.print (':');
    myFile.print (now.second(), DEC);
    myFile.print ("    La porte ne s'ouvre pas");  
  
}else{
  
    myFile.print (now.day(), DEC);
    myFile.print ('/');
    myFile.print (now.month(), DEC);
    myFile.print ('/');
    myFile.print (now.year(), DEC);
    myFile.print (" à ");
    myFile.print (now.hour(), DEC);
    myFile.print (':');
    myFile.print (now.minute(), DEC);
    myFile.print (':');
    myFile.print (now.second(), DEC);
    myFile.print ("    La porte est ouverte");}

  }else{

    STOPINTRU = STOPINTRU + 1;
    NBIntrusions = NBIntrusions + 1;
    lcd.clear();
    lcd.backLight(true);
    lcd.print("Mot de Passe :");
    lcd.setCursor(0, 1);
    lcd.print("Faux");
    digitalWrite (LEDRouge,HIGH);
    delay (350);
    digitalWrite (LEDRouge,LOW);
    delay (350);
    digitalWrite (LEDRouge,HIGH);
    delay (350);
    digitalWrite (LEDRouge,LOW);
    delay (350);
    digitalWrite (LEDRouge,HIGH);
    delay (350);
    digitalWrite (LEDRouge,LOW);
    delay (350);
    digitalWrite (LEDRouge,HIGH);
    delay (350);
    digitalWrite (LEDRouge,LOW);
    lcd.clear();
    lcd.print("NB Intrusions :");
    lcd.setCursor(0,1);
    lcd.print(NBIntrusions);
    password.reset();
    delay (2450); 
    lcd.clear();
    lcd.backLight(false);
    myFile.print (now.day(), DEC);
    myFile.print ('/');
    myFile.print (now.month(), DEC);
    myFile.print ('/');
    myFile.print (now.year(), DEC);
    myFile.print (" à ");
    myFile.print (now.hour(), DEC);
    myFile.print (':');
    myFile.print (now.minute(), DEC);
    myFile.print (':');
    myFile.print (now.second(), DEC);
    myFile.print ("    Mot de Passe faux entré");
    
         if (ButtonState == LOW){
        myFile.print (now.day(), DEC);
        myFile.print ('/');
        myFile.print (now.month(), DEC);
        myFile.print ('/');
        myFile.print (now.year(), DEC);
        myFile.print (" à ");
        myFile.print (now.hour(), DEC);
        myFile.print (':');
        myFile.print (now.minute(), DEC);
        myFile.print (':');
        myFile.print (now.second(), DEC);
        myFile.print ("    La porte s'ouvre qu'en même !");
}
    
  if (STOPINTRU==3){
        lcd.clear();
        lcd.backLight(true);
        digitalWrite(LEDRouge,HIGH);
        lcd.print("NB d'Intrusions");
        lcd.setCursor(0,1);
        lcd.print("Depasse");
        delay (2450);
        lcd.clear();
        lcd.print("Attendre 2 min");
        delay (117550);
        lcd.clear();
        STOPINTRU = 0;
        lcd.print("Entrer le Code");
        delay (2450);
        lcd.backLight(false);
        lcd.clear();
        myFile.print (now.day(), DEC);
        myFile.print ('/');
        myFile.print (now.month(), DEC);
        myFile.print ('/');
        myFile.print (now.year(), DEC);
        myFile.print (" à ");
        myFile.print (now.hour(), DEC);
        myFile.print (':');
        myFile.print (now.minute(), DEC);
        myFile.print (':');
        myFile.print (now.second(), DEC);
        myFile.print ("    3 tentatives dépasées, attendre 2 minutes");}
  }
}
  void cheek(){
 if (ButtonState == LOW){       
 
        myFile.print (now.day(), DEC);
        myFile.print ('/');
        myFile.print (now.month(), DEC);
        myFile.print ('/');
        myFile.print (now.year(), DEC);
        myFile.print (" à ");
        myFile.print (now.hour(), DEC);
        myFile.print (':');
        myFile.print (now.minute(), DEC);
        myFile.print (':');
        myFile.print (now.second(), DEC);
        myFile.print ("    La porte s'ouvre sans qu'aucun mot de passe ait été tapé !");
      
       if (ButtonState == HIGH){
       myFile.print (now.day(), DEC);
        myFile.print ('/');
        myFile.print (now.month(), DEC);
        myFile.print ('/');
        myFile.print (now.year(), DEC);
        myFile.print (" à ");
        myFile.print (now.hour(), DEC);
        myFile.print (':');
        myFile.print (now.minute(), DEC);
        myFile.print (':');
        myFile.print (now.second(), DEC);
        myFile.print ("    La porte c'est refermée");}
 }
  }

et voilà les méssages d'erreur :

On dirait que tu as deux librairies (#include) qui définissent chacune une variable IDLE de même nom.

Merci, mais concrètement que puis-je faire ?

Bonjour,

EBanou:
Merci, mais concrètement que puis-je faire ?

Regarde dans les deux .h où sont défini les variables "IDLE" en question.
Donne nous le code de la partie en question, si c'est juste des "enum" ça peut se résoudre sans trop de probléme.

Pour la librairie gsm j'ai ça:

/*
This file is part of the GSM3 communications library for Arduino
-- Multi-transport communications platform
-- Fully asynchronous
-- Includes code for the Arduino-Telefonica GSM/GPRS Shield V1
-- Voice calls
-- SMS
-- TCP/IP connections
-- HTTP basic clients

This library has been developed by Telefónica Digital - PDI -
- Physical Internet Lab, as part as its collaboration with
Arduino and the Open Hardware Community. 

September-December 2012

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

The latest version of this library can always be found at
https://github.com/BlueVia/Official-Arduino
*/
#ifndef _GSM3MOBILEACCESSPROVIDER_
#define _GSM3MOBILEACCESSPROVIDER_

enum GSM3_NetworkStatus_t { ERROR, IDLE, CONNECTING, GSM_READY, GPRS_READY, TRANSPARENT_CONNECTED};

class GSM3MobileAccessProvider
{
	public:
		// Access functions
		//Configuration functions.
		/** Establish GSM connection
			@param pin			PIN code
			@param restart		Determines if hardware restart
			@param synchronous	Determines sync mode
			@return If synchronous, GSM3_NetworkStatus_t. If asynchronous, returns 0.
		 */
		virtual inline GSM3_NetworkStatus_t begin(char* pin=0,bool restart=true, bool synchronous=true)=0;
		
		/** Check network access status
			@return 1 if Alive, 0 if down
		*/
		virtual inline int isAccessAlive()=0;
		
		/** Shutdown the modem (power off really)
			@return true if successful
		 */
		virtual inline bool shutdown()=0;
		
		/** Get last command status
			@return returns 0 if last command is still executing, 1 success, >1 error
		 */
		virtual int ready()=0;
};

#endif

Et pour la librairie Keypad j'ai ça :

/*
||
|| @file Keypad.h
|| @version 3.1
|| @author Mark Stanley, Alexander Brevig
|| @contact mstanley@technologist.com, alexanderbrevig@gmail.com
||
|| @description
|| | This library provides a simple interface for using matrix
|| | keypads. It supports multiple keypresses while maintaining
|| | backwards compatibility with the old single key library.
|| | It also supports user selectable pins and definable keymaps.
|| #
||
|| @license
|| | This library is free software; you can redistribute it and/or
|| | modify it under the terms of the GNU Lesser General Public
|| | License as published by the Free Software Foundation; version
|| | 2.1 of the License.
|| |
|| | This library is distributed in the hope that it will be useful,
|| | but WITHOUT ANY WARRANTY; without even the implied warranty of
|| | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
|| | Lesser General Public License for more details.
|| |
|| | You should have received a copy of the GNU Lesser General Public
|| | License along with this library; if not, write to the Free Software
|| | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
|| #
||
*/

#ifndef KEYPAD_H
#define KEYPAD_H

#include "utility/Key.h"

// Arduino versioning.
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

// bperrybap - Thanks for a well reasoned argument and the following macro(s).
// See http://arduino.cc/forum/index.php/topic,142041.msg1069480.html#msg1069480
#ifndef INPUT_PULLUP
#warning "Using  pinMode() INPUT_PULLUP AVR emulation"
#define INPUT_PULLUP 0x2
#define pinMode(_pin, _mode) _mypinMode(_pin, _mode)
#define _mypinMode(_pin, _mode)  \
do {							 \
	if(_mode == INPUT_PULLUP)	 \
		pinMode(_pin, INPUT);	 \
		digitalWrite(_pin, 1);	 \
	if(_mode != INPUT_PULLUP)	 \
		pinMode(_pin, _mode);	 \
}while(0)
#endif


#define OPEN LOW
#define CLOSED HIGH

typedef char KeypadEvent;
typedef unsigned int uint;
typedef unsigned long ulong;

// Made changes according to this post http://arduino.cc/forum/index.php?topic=58337.0
// by Nick Gammon. Thanks for the input Nick. It actually saved 78 bytes for me. :)
typedef struct {
    byte rows;
    byte columns;
} KeypadSize;

#define LIST_MAX 10		// Max number of keys on the active list.
#define MAPSIZE 10		// MAPSIZE is the number of rows (times 16 columns)
#define makeKeymap(x) ((char*)x)


//class Keypad : public Key, public HAL_obj {
class Keypad : public Key {
public:

	Keypad(char *userKeymap, byte *row, byte *col, byte numRows, byte numCols);

	virtual void pin_mode(byte pinNum, byte mode) { pinMode(pinNum, mode); }
	virtual void pin_write(byte pinNum, boolean level) { digitalWrite(pinNum, level); }
	virtual int  pin_read(byte pinNum) { return digitalRead(pinNum); }

	uint bitMap[MAPSIZE];	// 10 row x 16 column array of bits. Except Due which has 32 columns.
	Key key[LIST_MAX];
	unsigned long holdTimer;

	char getKey();
	bool getKeys();
	KeyState getState();
	void begin(char *userKeymap);
	bool isPressed(char keyChar);
	void setDebounceTime(uint);
	void setHoldTime(uint);
	void addEventListener(void (*listener)(char));
	int findInList(char keyChar);
	int findInList(int keyCode);
	char waitForKey();
	bool keyStateChanged();
	byte numKeys();

private:
	unsigned long startTime;
	char *keymap;
    byte *rowPins;
    byte *columnPins;
	KeypadSize sizeKpd;
	uint debounceTime;
	uint holdTime;
	bool single_key;

	void scanKeys();
	bool updateList();
	void nextKeyState(byte n, boolean button);
	void transitionTo(byte n, KeyState nextState);
	void (*keypadEventListener)(char);
};

#endif

/*
|| @changelog
|| | 3.1 2013-01-15 - Mark Stanley     : Fixed missing RELEASED & IDLE status when using a single key.
|| | 3.0 2012-07-12 - Mark Stanley     : Made library multi-keypress by default. (Backwards compatible)
|| | 3.0 2012-07-12 - Mark Stanley     : Modified pin functions to support Keypad_I2C
|| | 3.0 2012-07-12 - Stanley & Young  : Removed static variables. Fix for multiple keypad objects.
|| | 3.0 2012-07-12 - Mark Stanley     : Fixed bug that caused shorted pins when pressing multiple keys.
|| | 2.0 2011-12-29 - Mark Stanley     : Added waitForKey().
|| | 2.0 2011-12-23 - Mark Stanley     : Added the public function keyStateChanged().
|| | 2.0 2011-12-23 - Mark Stanley     : Added the private function scanKeys().
|| | 2.0 2011-12-23 - Mark Stanley     : Moved the Finite State Machine into the function getKeyState().
|| | 2.0 2011-12-23 - Mark Stanley     : Removed the member variable lastUdate. Not needed after rewrite.
|| | 1.8 2011-11-21 - Mark Stanley     : Added test to determine which header file to compile,
|| |                                          WProgram.h or Arduino.h.
|| | 1.8 2009-07-08 - Alexander Brevig : No longer uses arrays
|| | 1.7 2009-06-18 - Alexander Brevig : This library is a Finite State Machine every time a state changes
|| |                                          the keypadEventListener will trigger, if set
|| | 1.7 2009-06-18 - Alexander Brevig : Added setDebounceTime setHoldTime specifies the amount of
|| |                                          microseconds before a HOLD state triggers
|| | 1.7 2009-06-18 - Alexander Brevig : Added transitionTo
|| | 1.6 2009-06-15 - Alexander Brevig : Added getState() and state variable
|| | 1.5 2009-05-19 - Alexander Brevig : Added setHoldTime()
|| | 1.4 2009-05-15 - Alexander Brevig : Added addEventListener
|| | 1.3 2009-05-12 - Alexander Brevig : Added lastUdate, in order to do simple debouncing
|| | 1.2 2009-05-09 - Alexander Brevig : Changed getKey()
|| | 1.1 2009-04-28 - Alexander Brevig : Modified API, and made variables private
|| | 1.0 2007-XX-XX - Mark Stanley : Initial Release
|| #
*/

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Dans le fichier "utility/Key.h" de la lib Keypad tu doit avoir :

typedef enum{ IDLE, PRESSED, HOLD, RELEASED } KeyState;

En modifiant cette ligne par :

typedef enum{ /*IDLE,*/ PRESSED, HOLD, RELEASED } KeyState;

ça devrait être bon.

merci :slight_smile: