groundFungus:
This is the part that moves the motor.
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
if you will notice, the HIGH moves down one position for each beam.
The next move is
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
And the next move:
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
And so on. The HIGH moves down and after motor4 is HIGH it goes to the top to start over again.
So do you see what you have to do to do 2 steps? You need to move the HIGH twice with a small delay between calls to move to give the motor time to move. Probably have to experiment to find the delay that works.
Like I said, rewriting the code to use the stepper library could reduce all of that to
stepper.step(2):
for each beam.
First, thank you very much man, you're helping me a lot here!
So, if I got it correctly, I need to add this line first:
Stepper myStepper = Stepper(48, 8, 9, 10, 11)
And that helps the arduino recognize the stepper motor I have, with how many spr, and on which pins it connected, right?
After I have it recognized, I can replace the digitalWrite(motorpin1,2..) in every beam with this?
stepper.step(2):
Do I need to set a nominal rotation speed or something?
Thanks again!!!