I am trying to create a project which involves getting latitude and longitude via GPS Module and send it via GSM Module. My problem here is that individual code is working perfectly. However, if am to initialize both together, none will work.
#include "GSM.h"//wrapper class for Sim800l library
#include "GPS.h"//wrapper class for TinyGPS library
GSM *gsm;
GPS *gps;
void setup()
{
Serial.begin(9600); // Debugging only
gsm = new GSM();//initializes SIM800l
//gps = new GPS(11,10 );//initializes NEO6MV2//uncommmenting this line won't make both modules work
}
String telNum;
int i = 1;
void loop()
{
/*
Serial.println(gps->getLongitude(),6);
Serial.println(gps->getLatitude(),6);
*/
Serial.println(gsm->read(i,telNum));
Serial.println(telNum);
++i;
}