Error drum arduino nano

I FOUND A PROBLEM ON MY ARDUINO,, MY SD CARD MODULE IS NOT READ BY THE ARDUINO WITH ERROR DESCRIPTION..PLEASE HELP ME TO COMPLETE THIS PROJECT

Please post your code in code tags <code/>
Could you make a schematic of your project?
Photos of the setup?
This will help us help you.
Thank you.
This is what a program will look like when in code tags.

void setup(){
// stuff here
}

void loop(){
// loop stuff
}
SD fail
SD fail

Do you have an SD card adapter connected, receiving enough power with the SD card inserted?

This is for the rest of your sketch...

#include <SD.h> // need to include the SD library
//#include <SDfatlib.h>

#define SD_ChipSelectPin 4 //example uses hardware SS pin 53 on Mega2560
//#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins

#include <TMRpcm.h>
#include <SPI.h>

TMRpcm tmrpcm;

int knockSensor = 0;
int knockSensor1 = 1;
int knockSensor2 = 2;
int knockSensor3 = 3;

byte val = 0;
byte val1 = 0;
byte val2 = 0;
byte val3 = 0;

int THRESHOLD = 80;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

tmrpcm.speakerPin = 9; //46 on Mega, 9 on Uno, Nano, etc

//Serial.begin(9600);
pinMode(9,OUTPUT);
//digitalWrite(46,HIGH);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
else{
Serial.println("Done");
}

}

void loop() {

val = analogRead(A1);
val1 = analogRead(A2);
val2 = analogRead(A3);
val3 = analogRead(A4);

if (val >= THRESHOLD) {
tmrpcm.play("PAD1.wav");

}
if (val1 >= THRESHOLD) {
tmrpcm.play("PAD2.wav");

}
if (val2 >= THRESHOLD) {
tmrpcm.play("PAD3.wav");

}
if (val3 >= THRESHOLD) {
tmrpcm.play("PAD4.wav");

}

}

#include <SD.h> // need to include the SD library
//#include <SDfatlib.h>

#define SD_ChipSelectPin 4 //example uses hardware SS pin 53 on Mega2560
//#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins

#include <TMRpcm.h>
#include <SPI.h>

TMRpcm tmrpcm;

int knockSensor = 0;
int knockSensor1 = 1;
int knockSensor2 = 2;
int knockSensor3 = 3;

byte val = 0;
byte val1 = 0;
byte val2 = 0;
byte val3 = 0;

int THRESHOLD = 80;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

tmrpcm.speakerPin = 9; //46 on Mega, 9 on Uno, Nano, etc

//Serial.begin(9600);
pinMode(9,OUTPUT);
//digitalWrite(46,HIGH);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
else{
Serial.println("Done");
}

}

void loop() {

val = analogRead(A1);
val1 = analogRead(A2);
val2 = analogRead(A3);
val3 = analogRead(A4);

if (val >= THRESHOLD) {
tmrpcm.play("PAD1.wav");

}
if (val1 >= THRESHOLD) {
tmrpcm.play("PAD2.wav");

}
if (val2 >= THRESHOLD) {
tmrpcm.play("PAD3.wav");

}
if (val3 >= THRESHOLD) {
tmrpcm.play("PAD4.wav");

}

}
IS SOMETHING WRONG WITH MY SKETCH? PLEASE HELP ME

Could you post the schematic?
No idea about the sketch. Not my expertise.
Code tags?
Take a look at this:

Thanks.

WHAT DO YOU MEAN CABLE ROUTING FROM ARDUINO TO SD CARD MODULETeks terformat

Thanks

1 Like

sorry i just copy the text in google translate ,, i cannot speak english ..forgive me if itype wrong :pray: :pray: :pray:

FYI:
If you want and your Language is in the category you can use the international categories.
But let's stick to this topic(no cross-posts please).
Thanks.

Can we have serval photos of the wiring, preferably from different angles?
Thanks.

Me too but I type in lowercase. :wink:

Post #3 was three questions:

  1. Are the pins on your SD card reader/adapter connected to the right pins on the Arduino (13, 12, 11, 10, Vcc, GND)?
  2. is there enough power for the SD card reader (are there more devices using Arduino power)?
  3. Is a formatted SD card inserted into the SD card reader?

Read Post #6.

this is the pin path i used


sd

Is this the right configuration for the nano?
Is the button debounced?
Are those one circuit or two?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.