Problem with simple button code

Sorry, incorrect info. please delete post.

If ((Steps == 0) && (digitalRead(2) == LOW))

What is connected to pin 2?

until the signal is received

That, of course, tells us NOTHING. What signal? Received from Uranus?

It is pointless to post code that reads the state of pins that have switches connected to them (or buttons sewn onto them) without telling HOW the "button" is sewn on.

if ((Steps == 0) && (digitalRead(2) == LOW))
{
. . .
Steps = Steps + 1;
}

Since Steps is 0 at reset, the code in the if() {} will only run only once.
i.e. until Steps = Steps +1; is executed.

.

That was part of my problem. That was a typo and should have been pin 12. As soon as I posted I saw that which is why I deleted the content of my post. I have another issue and will repost once I figure out what is actually working and not working. Sorry for the confusion.

PaulS: That, of course, tells us NOTHING. What signal? Received from Uranus?

It is pointless to post code that reads the state of pins that have switches connected to them (or buttons sewn onto them) without telling HOW the "button" is sewn on.

Paul I understand what you are saying but for my testing I DID tell you. I'm grounding pin 12 to bring it low and doing a digital read of that pin (although due to a typo it was reading pin 2, not 12. I am a novice to Arduino so I tend to work on my projects in smaller segments otherwise I'm overwhelmed by the coding required. Other than the typo I think I explained what is happening and what I wanted to happen pretty clearly.....something I just saw you comment on in another post. If it helps.....I'm not 100% sure in the final interation of this program exactly how the signals will be received because this is a retrofit to an existing machine. It is currently moved by an air cylinder which I believe is actuated by a solenoid valve. I will probably replace the solenoid valve with a relay so that when it closes it grounds pin 12, just like I'm doing now.