I tested the SD Card Sheild sample programs and they worked well.Also I tested Centipede Sheild programes and they worked well.But when I had added this centipede's code to the simple SD card code, it wouldn't work.
CS.initialize(); // set all registers to default
CS.portMode(0, 0b0000000000000000); // set all pins on chip 0 to output
I think it was caused by around SS, how do you think about it?
I think it was caused by around SS, how do you think about it?
We cannot think about it because you don't supply the whole code. The code you posted is most probably not responsible for your problems.
The SD card shield from Seeedstudio and the centipede shield don't have conflicting pin usages so from the hardware perspective it should be OK. That leaves the software but you haven't supplied it.
I had tried your suggestion "const uint8_t chipSelect = 10;", but it seemed nothing to be changed. I used "cout" only for debugging. I will delete these codes when it works completely.
The conditions are unstable. Actually sometimes it worked well with the "CS" codes, but sometimes it wouldn't work.
That meant: Where do you have the class ArduinoOutStream from. I cannot find it in your code and it's not a standard class. You didn't provide a link to it, so I have no clue about it's internals. Have you written it yourself? Did you copy it from somewhere? It's possible that this class is responsible for your problems.