Page 1 of 1

[Solved] SdFat Library Compilation Error on CT-ARM

PostPosted: Wed Jan 03, 2018 5:23 pm
by JayJoe
Hi,

I wish to use this library for my CT-ARM project too. But unfortunately, it has compilation error too. The sketch I am using is dataLogger, can be found in the 'examples' folder.

This library is better than SD.h in data logging, I am sure by making SdFat.h available for CT-ARM will be beneficial to others too :D

Looking forward. Thanks.

https://github.com/greiman/SdFat

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Thu Jan 04, 2018 4:56 pm
by bengchet
Hi,

You don't need to install extra SdFat library. CT-ARM has already included the SdFat library which have been tested working and compiled successfully with. The latest SdFat library might have some changes to work with other compatible boards so might not work well with CT-ARM( added new functions etc)

Try remove the SDFat library, or move the library to other place temporary from Arduino Library folder.

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Thu Jan 04, 2018 5:10 pm
by JayJoe
Hi,

Found. Thank you :)

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Sun Jan 07, 2018 1:55 am
by JayJoe
Hi, I have another problem.

I will need to use testGetline() function from getline.ino, and implement into my project. I notice that the compilation of getline.ino already comsumes 76% of dynamic memory. And after combining the testGetline() function with my project's coding, as expected, it shows compilation error.

Is it possible to reduce the consumption in this case? :|

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Mon Jan 08, 2018 12:31 pm
by JayJoe
UPDATES

solved by doing so

CODE: SELECT_ALL_CODE
int getTotalLines()
{
  String buffer;
  unsigned int line_number = 0;

  myFile = sd.open(fileName);

  while(myFile.available())
  {
    buffer = myFile.readStringUntil('\n');
    line_number++;
  }
 
  myFile.close();
  return line_number;
}

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Tue Jan 09, 2018 10:36 am
by bengchet
Hi,

Yes, should be simple as that. Well done! ;)

Re: SdFat Library Compilation Error on CT-ARM

PostPosted: Wed Jan 10, 2018 10:07 pm
by JayJoe
thanks to u bengchet, i appreciate :)