sim800cmd.h + Keypad.h doesn't work

Hi,

i have a library sim800 to control ( SKU:TEL0089 ) SIM800H GPRS Shield V1.0 Communication Module and I also have a keypad 4x3 and keypad library for it. I'd like to create a project that will be sending diffrent text message after pressing diffrent key, but when I add #include <Keypad.h> there is an error and I can't compile my project. I have IDE 1.0.6 and Arduino Leonardo.

In the future I'd like to add LCD and I checked, and if I add #include <LiquidCrystal_I2C.h> there is no problem.

There is my Sketch:

#include <sim800cmd.h>
#include <Wire.h>
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
 {'1','2','3'},
 {'4','5','6'},
 {'7','8','9'},
 {'*','0','#'}
};
byte rowPins[ROWS] = {4, 5, 6, 7}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 9, 10}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

//initialize the library instance
//fundebug is an application callback function,when someon is calling.
Sim800Cmd sim800demo(fundebug);

//the setup routine runs once when you press reset:
void setup()
{
   //initialize SIM800H,return 1 when initialize success.
   while((sim800demo.sim800init()) == 0);
   delay(1000);
   //enable SMS prompt
   sim800demo.setSMSEnablePrompt(OPEN);
}
void loop()
{
 char key = keypad.getKey();

 if (key == 1){
   //send message to telephone,use UCS2 code
   sim800demo.sendSMS("003700390031003000380038","004F006E0065");
   //while, do not return
   while(1);
 }
if (key == 2){
   //send message to telephone,use UCS2 code
   sim800demo.sendSMS("003700390031003000380038","00540077006F");
   //while, do not return
   while(1);
 };
}

//application callback function
//Note that not too much to handle tasks in this function
void fundebug(void)
{
}

Keypad and SendSMS are working separately.

There is an error:

Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Leonardo"
SendSMS.ino: In function 'void setup()':
SendSMS:29: error: invalid conversion from 'int' to 'reqmodle_t'
SendSMS:29: error: initializing argument 1 of 'void Sim800Cmd::setSMSEnablePrompt(reqmodle_t)'

What I have to do to fix it and compile my project?

I'm trying to make simple alarm with GSM Sheld, keypad, LCD and PIR...

If line 29 is:

   sim800demo.setSMSEnablePrompt(OPEN);

I would guess that both libraries are defining a constant called OPEN with considerably different types. You'll need to modify one of the libraries to use some other name.

Tried to change OPEN to OPN everywhere in both libraries but still there is a problem:

error: 'OPN' was not declared in this scope

Maybe there is a way to modify library, but apparently I don't have skills for this :slight_smile:

I also tried to use PCF8574 and I2C keypad library, but Keypad library is still needed.

I think maybe I'll find another way to do this or I'll create my own function for checking which button is pressed on my keypad.

Thanks for Your time..

Tried to change OPEN to OPN everywhere in both libraries

Wrong. You would change OPEN to OPN in ONE of the libraries, and leave it OPEN in the other one.