- Wed Apr 04, 2018 12:36 pm
#198835
Hello
I am working on a large sketch project with an eye on turning it into a library. I am not ready to turn the sketch to library right now, but I want to include what might be needed into the sketch.
The question I have is there a way to call a user sketch from inside a library . The following code shows what I am talking about
Library cpp file
SD.print(Log_Sample_Num)
SD.print(" ,)";
SD.print(Log_Time);
SD.print(" ,");
SD.println(SampleDataString());
User Sketch file
String SampleDataString()
{
String ReturnString = ""
if(GPS.fix)
{
RerurnString = GPS.Lat + GPS.Long;
}
else
{
ReturnString = "*****,*****,";
}
// Gentrate the rest of ReturnString
return ReturnString;
}
Thanks for help
I am working on a large sketch project with an eye on turning it into a library. I am not ready to turn the sketch to library right now, but I want to include what might be needed into the sketch.
The question I have is there a way to call a user sketch from inside a library . The following code shows what I am talking about
Library cpp file
SD.print(Log_Sample_Num)
SD.print(" ,)";
SD.print(Log_Time);
SD.print(" ,");
SD.println(SampleDataString());
User Sketch file
String SampleDataString()
{
String ReturnString = ""
if(GPS.fix)
{
RerurnString = GPS.Lat + GPS.Long;
}
else
{
ReturnString = "*****,*****,";
}
// Gentrate the rest of ReturnString
return ReturnString;
}
Thanks for help