I have this SD-card module. I have formatted the SD with this tool. My problem is that the Arduino Uno can't initialize the SD. I tried with this script:
// include the SD library:
#include <SPI.h>
#include <SD.h>
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;
const int chipSelect = 7;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
}
void loop(void) {
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("Doesn't work properly");
} else{
Serial.println("works properly");
}
delay(2000);
}
And the result:
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
works properly
works properly
works properly
works properly
works properly
works properly
Doesn't work properly
Doesn't work properly
Doesn't work properly
works properly
works properly
works properly
Doesn't work properly
The "works properly" happens, usually, when I move the module slightly. Is there a way to repair the module?
OS: Windows 10