I’m trying to read text data from an SD Card and I’d like to use ‘readBytesUntil()’ to read an entire record at a time (up to 10 characters between delimiter characters).
I had it working at one time but after struggling with upload issues to a Mega2560 (switching from Arduino IDE v1.0 to v0.0022) I now get a compiler error:
‘class File’ has no member named ‘readBytesUntil’
#include <SD.h>
File dataFile;
void setup() {
Serial.begin(9600);
// Parameters
char* fileName = "name.txt"; // filename for data file
char* readBuffer = "**********"; // Buffer used to read a record
char delimiter = ','; // A character that separates records
int bufferLength = 10; // Size of data read buffer
dataFile = SD.open(fileName, FILE_READ);
if (dataFile) {
int index = dataFile.readBytesUntil(delimiter, readBuffer, bufferLength);
}
}
void loop() {
}
I’m running Arduino IDE v0.0022 (both Mac and PC)
I’m using the SD.h library from ADAFRUIT, located in the ‘libraries’ folder. I did NOT replace the SD.h library located within the MacOS application.
Thanks in advance for your help.