Thanks to all of you!
Finally I have solve the problem by using the SD.h library (correctly).
Basically, i have used the followings codes and blocks:
To start the conection between the SD and the PC-Arduino
Serial.print("Iniciando SD ...");
if (!SD.begin(4)) {
Serial.println("No se pudo inicializar");
return;
}
Serial.println("inicializacion exitosa");
[/code
This to open/create a file and to save there the movements of the servos and them to close the file:
[code]
myFile = SD.open("Prueba.txt", FILE_WRITE); // Note
if(myFile)
Serial.println("file is open");
else
Serial.println("Error opening the file");
...
int pos = dxlGetPosition(SERVO_ID[j]);
myFile.println(pos); //read and save the actual position
...
myFile.close(); //close the file
I have add a new variable in the program (this variable datas come from the SD), and I have used like the variable of the positionn that I have put in the previous posts, to read te datas i have used myFile.parseint:.
int pos_from_file[servo_count];
...
pos_from_file[i] = myFile.parseInt();
And finally this block to delete the file at the end of the program:
if (SD.exists("Prueba.txt")) { // SI EXISTE EL ARCHIVO
SD.remove("Prueba.txt"); // ELIMINAR ARCHIVO
Serial.println("SD FILE REMOVED");
} else {
Serial.println("THE FILE DOESN´T EXIST");
}