sd library conflict with digitalRead

When i delet ditialButtons() , the sd library works correctly.

void readPushButtons(){
  uiStep();
  analogButtons();
  logicAnalogButtons();
  //digitalButtons();
  //logicDigitalButtons();
}
void initialButtons(){
  pinMode(stepPin, INPUT_PULLUP);   ///set the pin with internal pullup resistor
  pinMode(feedPin, INPUT_PULLUP);   ///set the pin with internal pullup resistor
}
void digitalButtons(){
  stepState = digitalRead(stepPin);   ///record pin state
  feedState = digitalRead(feedPin);   ///record pin state
}
File root;
File entry;
File myFile;
/////////////////////////////////initial sd card///////////////////////////////////
void ini_sd() {
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.print("Initial SD card...");
  if (!SD.begin(10)) {
    Serial.println("initial failed!");
    return;
  }
  Serial.println("initial done.");
  root = SD.open("/");
  printDirectory(root, 0);   //output file name
  //Serial.println("done!");   //degug
}
void printDirectory(File dir, int numTabs) {
  while (true) {
    entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
      
    }
    if (entry.isDirectory()) {
      Serial.println(" ");   // do nothing with directory
      //printDirectory(entry, numTabs + 1);
    } else {
      menu_strings[nfiles] = strdup(entry.name());   //store file name
      //Serial.println(menu_strings[nfiles]);   //test if menu_strings is right
     
      nfiles++;
    }
    entry.close();
   // Serial.print(menu_strings[3]);   //test if menu_strings is right
    free(menu_strings[nfiles]);   //free memory   
  }
  Serial.println(nfiles);   //debug ,print file number
}
void setup() {
  ini_sd();
  initialButtons();


When i add digitalButtons(), incorrectly.

void readPushButtons(){
  uiStep();
  analogButtons();
  logicAnalogButtons();
  digitalButtons();
  //logicDigitalButtons();
}

Did you enter the code on the Arduino using a camera? Post TEXT as TEXT, not as pictures.

11512991203:
Thanks.
It acts like that.

Posting your pictures inline does NOT change the fact that you did not post your text (code) AS TEXT!.

If you can't follow simple directions, in the sticky at the top of every section of the forum, why should we try to help you?

If i don't put the image , you won't understand it !

What? You think I can't read simple text? Well, f**k you, too.

(deleted)

11512991203:
Since the problem is there ,why not solve the problem firstly.

Because no one wants to re-type all the code. Get it ? ? ? ?

ieee488:
Because no one wants to re-type all the code. Get it ? ? ? ?

oh,I get it. I think no one will test it on arduino but give a idea through image at the beginning. thanks,i will modify it .

@11512991203, it is a good idea to read through maybe half a dozen other Threads to see how things are done before you start with your own question. And it is not too late to do that now.

...R

Also posted at:

If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.

This almost certainly isn't caused by a bug in the SD library. It's caused by some problem in the code you refuse to post. Instead of being stubborn with the people trying to help you here and opening an invalid bug report on GitHub you could have spent much less time providing the information we need and you would have already had an answer.

pert:
Also posted at:
https://github.com/arduino-libraries/SD/issues/49
If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.

This almost certainly isn't caused by a bug in the SD library. It's caused by some problem in the code you refuse to post. Instead of being stubborn with the people trying to help you here and opening an invalid bug report on GitHub you could have spent much less time providing the information we need and you would have already had an answer.

You are right.thanks.
the left code is so much,i think it is unsuitable to copy all of it .
When i delet the digitalButtons(),it works correctly, so i think this is a problem not others. So that i didn't copy left code.

That’s actually fine if you don’t want to post a lot of irrelevant code. The best way to deal with something like this is to provide a minimal complete sketch that demonstrates the problem. Give us everything we need to reproduce the issue without anything extra. Often by the time I get done producing a minimal demonstration it has led me to find the issue. We don’t request people to provide a minimal complete demonstration very often here because with beginners its often easier just to get the full code, even though it’s more work for the people trying to help.

So post the minimal complete demonstration sketch as text using code tags (</> button on the toolbar) along with any other details we might require, such as which board you’re using.

@11512991203 - Please try to imagine if you were trying answer this question. Yeah, I'm sure you probably only think of this forum as a place to receive help. But for you to receive help, other people must give you that help. Please try to understand this from the perspective of people (like all of us who have replied) who actually give the help.

The first thing any of us needs to do is copy-and-paste the code into Arduino and click Verify. I did that just now, with your edited message. I get this:

sketch_jan19a:63: error: expected '}' at end of input
   initialButtons();
                   ^
'uiStep' was not declared in this scope

Your program does not even verify! Nobody can help if the code does not actually reproduce the problem when we try to use it.

I know you would probably like to hear a solution. You would probably like to avoid doing more work. I get that. Everyone wants to avoid spending more time.

But consider you are talking to real people. We all have limited time. By posting an incomplete program, and by posting duplicate requests in multiple locations, you are wasting all of our time, AND you make any real help impossible.

If you have any sense of decency, any honest nature within you, please PUT IN SOME REAL WORK to reduce your code to a small size program which shows the problem. Check the small program carefully, so you are sure the code you post actually does recreate the problem. Remember, unpaid people will spend their time to try running your code and then try to find the problem (which may be in the SD library, or may be in your code, or may be some other issue).

The point is real humans are here, spending their limited time, and we are still unable to help you. Please, be polite and considerate of other people's time when they only wish to assist you. You can do so much better, to reduce your code, and to properly verify it BEFORE you ask other humans to spend their time verifying and analyzing the problem!