Step motor with button

bunogenrinho:
It means that the button has 2 wires and one is at pin 2 and the other is connected at GND

So, no external resistor? You need to add one, or use the internal pullup resistor.