Hello,
First post here, I am trying to have my bipolar stepper motor to run continuously while still knowing how many steps it has taken. My issue is that I need the arduino to do other things while the motor is running.
Quick overview of my project:
-Turn stepper motor on
-Every 25 steps turn RGB color sensor on
-When IR sensor go off, activate solenoid to open gate
-There are a total of 11 IR sensors (1 before and 1 after each gate) and 5 solenoids
I have just recieved the stepper motor, motor driver, and RGB color sensor.
So far ive written a for loop… for(stepCount=0; stepCount<25; stepCount++) …then i activated the RGB. This was just to test that everything works.
Ive attached a state machine diagram that i thought might work for my project, as you can tell… I need the stepper motor to run continuously. Any ideas on how to make it work? Arduino’s stepper library doesnt have a command that will work for this project.
If you are using a stepper driver that takes step and direction signals then have a look at the second example in this Simple Stepper Code. It could easily be adapted for continuous running. Every time you ask it to take a step just increment a variable to count the number of steps.
Or just use the Stepper library to make 1 step each time.