Project Guidance Regarding Arduino and a Stepper Motor

Ok so to start off I am new at using Arduino as I was first introduced to it this semester in one of my college courses. For the final project in this course my group partner and I have run into a bit of trouble regarding the coding of the stepper motor we have planned to use. So we have taken to the forum to search for guidance!

Brief Rundown of Project:
We have a laser cut arrow with seven rows of LEDs on top with the colors of each row alternating between red and green. The plan is for this arrow to on a table and spin stopping at intervals (which we decided we would have 10 of as we are using the large stepper motor that has 200 steps and that means the intervals are those of 20) at the intervals it stops and thus points at there would be a person from our class placed. The lights atop the arrow would then display a light sequence once stopped and upon seeing the light sequences my partner and I will place certain stickers upon the chosen people's foreheads. The problem is working out the code for the motor itself.

Summary of Plans for Motor to do:
Spin forwards or backwards to one of ten intervals which the ten intervals will be intervals of 20
Stop at the chosen interval for a minute then spin back to starting position
Repeat this spin and stop 15-20 times
The intervals can be (hoping that it will be) random and can be repeated and not all need to be used before the end of the project

Thanks!

AFenn91:
The problem is working out the code for the motor itself.

There are plenty of examples showing how to control a stepper motor. Which ones have you tried?

Basically all I've done with stepper motor are in class examples so I know how to program a stepper motor to move forward and backward using single, double, interleave, and microstep steps. I also know how to program it to randomly determine the amount of steps or direction. That is pretty much it I believe in my knowledge of controlling a stepper motor.

AFenn91:
Basically all I've done with stepper motor are in class examples so I know how to program a stepper motor to move forward and backward using single, double, interleave, and microstep steps. I also know how to program it to randomly determine the amount of steps or direction.

Then it looks as though you have all the tools you need to get this going. If you ignore the requirement to return to a home position and don't ever stop, your main loop becomes:

Use random to give you a number between 1 and 10
Step 20 times that number
delay for sixty seconds

Once that's working, you should be able to add the two missing requirements without too much trouble.

wildbill:

AFenn91:
Basically all I've done with stepper motor are in class examples so I know how to program a stepper motor to move forward and backward using single, double, interleave, and microstep steps. I also know how to program it to randomly determine the amount of steps or direction.

Then it looks as though you have all the tools you need to get this going. If you ignore the requirement to return to a home position and don't ever stop, your main loop becomes:

Use random to give you a number between 1 and 10
Step 20 times that number
delay for sixty seconds

Once that's working, you should be able to add the two missing requirements without too much trouble.

I went through what you said and got a code that is working and is what we need for our project. Thanks alot!