Hi all I am not sure why I am getting so many compile errors. Pretty new to this and advice what be very much appreciate here is the code followed by the compile errors
[code#include <SoftwareSerial.h>
#include "SIM900.h"
#include <TinyGPS.h>
#include "sms.h"
SMSGSM sms;
TinyGPS gps;
SoftwareSerial ss(2, 3);
SoftwareSerial SIM900(8, 7);
static void smartdelay(unsigned long ms);
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_str(const char *str, int len);
String strL, strN, poss, tareq, textForSMS;
char charL[10], charN[10], text[400];
int o = 1;
boolean started = false;
void setup()
{
Serial.begin(9600);
ss.begin(9600);
}
void loop()
{
float flat, flon;
unsigned long age, date, time, chars = 0;
unsigned short sentences = 0, failed = 0;
while (o < 4) {
gps.f_get_position(&flat, &flon, &age);
textForSMS = "tareq Home"; //testing gps from here
Serial.println(textForSMS);
Serial.print("longitude: ");
print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);
Serial.println("");
Serial.print("latitude : ");
print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);
smartdelay(1000);
Serial.println(""); //till here
delay(1000);
o++;
}
Serial.println("nil"); //to check whether 'if' works
dtostrf(flat, 8, 6, charL);
for (int i = 0; i < 10; i++)
{
strL += charL*;*
- }*
- dtostrf(flon, 8, 6, charN);*
- for (int i = 0; i < 10; i++)*
- {*
_ strN += charN*;_
_ }_
_ tareq = "tareq Home Location";_
_ tareq = tareq + "\nlongitude: " + strN + "\nlatitude : " + strL;_
_ poss = tareq;_
_ poss.toCharArray(text, 400);_
_ gsm.begin(9600);_
_ delay(1000);_
_ Serial.println(text);_
_ if (sms.SendSMS("+8801839443686", text))_
_ {_
_ Serial.println("\nSMS sent OK.");_
_ }_
_ else*_
* {*
* Serial.println("\nError sending SMS.");*
* }*
* do {} while (1);*
* //}*
* //o++;*
}
static void smartdelay(unsigned long ms)
{
* unsigned long start = millis();*
* do*
* {*
* while (ss.available())*
* gps.encode(ss.read());*
* } while (millis() - start < ms);*
}
static void print_float(float val, float invalid, int len, int prec)
{
* if (val == invalid)*
* {*
* while (len-- > 1)*
_ Serial.print('');_
_ Serial.print(' ');_
_ }_
_ else*_
* {*
* Serial.print(val, prec);*
* int vi = abs( val);*
* int flen = prec + (val < 0.0 ? 2 : 1); // . and -*
* flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;*
* for (int i = flen; i < len; ++i)*
* Serial.print(' ');*
* }*
* smartdelay(0);*
}
static void print_str(const char str, int len)
_{_
_ int slen = strlen(str);_
_ for (int i = 0; i < len; ++i)_
_ Serial.print(i < slen ? str : ' ');
smartdelay(0);
}][/code]
and this is the compile errors
```*_
*Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"
In file included from C:\Program Files\Arduino\libraries\GSM_GPRS_GPS_Shield_GSMSHIELD\GSM.cpp:17:0:
C:\Program Files\Arduino\libraries\GSM\src/GSM.h:56:13: error: prototype for 'int GSM3ShieldV1AccessProvider::begin(long int)' does not match any in class 'GSM3ShieldV1AccessProvider'
#define GSM GSM3ShieldV1AccessProvider
^
C:\Program Files\Arduino\libraries\GSM_GPRS_GPS_Shield_GSMSHIELD\GSM.cpp:43:5: note: in expansion of macro 'GSM'
int GSM::begin(long baud_rate)
^
In file included from C:\Program Files\Arduino\libraries\GSM\src/GSM.h:45:0,
from C:\Program Files\Arduino\libraries\GSM_GPRS_GPS_Shield_GSMSHIELD\GSM.cpp:17:
C:\Program Files\Arduino\libraries\GSM\src/GSM3ShieldV1AccessProvider.h:80:24: error: candidate is: virtual GSM3_NetworkStatus_t GSM3ShieldV1AccessProvider::begin(char*, bool, bool)
GSM3_NetworkStatus_t begin(char* pin=0,bool restart=true, bool synchronous=true);
^
C:\Program Files\Arduino\libraries\GSM_GPRS_GPS_Shield_GSMSHIELD\GSM.cpp:315:21: error: variable or field 'InitParam' declared void
void GSM::InitParam(byte group)
^
C:\Program Files\Arduino\libraries\GSM_GPRS_GPS_Shield_GSMSHIELD\GSM.cpp:315:21: error: 'byte' was not declared in this scope
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
_```*_