Hi, I have a problem with my code I am trying to make a stepper motor rotate one way when one of two buttons is pressed and stop if none are pressed if the other button is pressed I want the stepper to rotate the other way. The problem I'm facing is that when I'm not pressing any buttons the stepper is still turning and when I press the buttons it doesn't affect the motor at all. Here is my code:
As you see from my code if a button is pressed there is a message printed on the serial monitor. The problem is that even when I'm not pressing the button the message still is sent (I checked with multiple components like microcontrollers and such so it's not a hardware issue).
Once it works properly, add the motor (which one?) and driver (which one? It looks like an ULN2003...) back again, but remember to connect GND from Arduino to the module and see what happens. And remember you need to power the motor with a separate power supply, not from Arduino.
As I already said in post#3, you first need to check if the buttons are working as expected.
Have you tested that and the buttons work correctly? And when the answer is "yes", put back the motor, make sure you don't power the motor from Arduino, and connect GND in common and see if it works now.