Hi to all,
I create a custom library. I'm using 1/4 of arduino memory.
I found a strange behavior, I call a subroutine that returns me a count of item of string by a char.
All normal right?
NO!
If I use a monitor, I read "Test" and after "End Test".
I use 8.226 bytes (max 32.256 bytes)
Do I have a problem of memory?
BUT If I try this subroutine directly into the sketch, I receive a correctly behavior.
Are there a limit If I use a custom library?
Into CPP file of library I use #include "Arduino.h" Is it correct?
I'm missing something?
int mylibrary::_splitCount(String textToSplit, char separator)
{
int count = 1;
Serial.println("Test");
int i = 0;
while(i < textToSplit.length()) //OR for(int i = 0; i < textToSplit.length(; i++) same behavior !
{
Serial.print(i,DEC);
Serial.print(" > ");
Serial.println(textToSplit[i]);
if(textToSplit[i] == separator)
count++;
i++;
}
Serial.println("End test");
return count;
}
Help!