Avoid the handshake getting a buffer!
Use SD.write(buf,size);
Hi every one, I'm working in a project with the same issue. I was following the same steps of yours and got exactly the same numbers. I've just fixed it out. The problem is the handshake when you call the SD.write()SD.write().
Instead:
//for each loop, it is going to make a handshake
while(<yourCondition){
//for each loop, it is going to make a handshake
while(<yourCondition>){
SD.write(<yourValue>);
}
}
Do:
char buf[length]
while(yourCondition){
char buf[length];
while(yourCondition){
buf[index] = yourValue;
}
SD.write(buf,index);//only one handshake
}
SD.write(buf,index);//only one handshake
In my project the first one I got 4100 bytebytes, and the second one using a buffer with 128 (buf[128]) I got 145408 bytebytes in my project. Good enough.