Every time I upload my updated code, while uploading, my stepper motor spins. This also happens when I plug my arduino to power.
I have no idea why he's doing that... Code below:
Solved: it only makes this when you update the code, but when you use a different power source for the installation there will be no problems.
What stepper motor drive are you using and how is it connected to the Arduino? And please do NOT post a Fritzing diagram. A photo of a simple pencil drawing will be much easier to understand, even if you are an awful artist.
While it is not relevant to your problem your code will be much easier to read and less error prone if you use variables (such as stepPin) to hold the values of the pins. That way, when reading the code you don't have to remember what pin 5 is connected to.
Apparently solved as there is no further reaction by the TO.
I also suspected RX/TX connections (when updating code), but would that explain also the behaviour in the powering up sequence?