SD Filenames
i keep getting errors when use sd.mkdir. code:
when run code, sd.mkdir(sen) returns false.
code: [select]
if(char(serialreceived) == '\n') {
serial.print("mkdir: ");
serial.println(serialcommand);
serial.println(serialcommand.length());
char sen[serialcommand.length()+1];
for(int = 0; < serialcommand.length(); i++) {
sen[i] = serialcommand.charat(i);
}
if(sd.mkdir(sen)) {
serial.write(6);
} else {
serial.write(21);
}
serialstate = 0;
serialcommand = "";
} else {
serialcommand += char(serialreceived);
}
when run code, sd.mkdir(sen) returns false.
you need store null @ end of string. try this:
you should make sure names use valid.
pete
code: [select]
int i;
for(i = 0; < serialcommand.length(); i++) {
sen[i] = serialcommand.charat(i);
}
sen[i] = 0;
you should make sure names use valid.
pete
Arduino Forum > Using Arduino > Storage > SD Filenames
arduino
Comments
Post a Comment