New project, and I was going to try to use an interrupt

I have a geared stepper that rotates a wheel that has an antenna mount on it. It is to tilt the antenna when I approach a low handing garage door, or trees.

The motor only needs to move 1/4 of a turn, from antenna up, to antenna down. Moving the stepper is no problem, but I need it to stop at the correct place, and I have two micro switches that are in parallel, so one is when it is up, and one is when it is down.

I was thinking of using an interrupt to stop movement in either direction, but I immediately saw a problem with that. If there is a way do use the interrupt I would like some details to explain how.

The alternative is to just allow enough pulses to move in each direction. The motor can be turned off because the gearing on the stepper makes it very difficult to turn by hand, so I am sure with the motor off, it will hold still.

I could also put stop screws to keep the antenna from overshooting where it should stop , and hitting my roof.

I also trying to use the Easy Driver to do this, and I think that might be the easiest way to go about moving the stepper.

Any help would be appreciated, I have been away from Arduino programming for a while, and I forgot most of what I knew.

Thanks, Joe

LearningIsFun:
...I have two micro switches that are in parallel, so one is when it is up, and one is when it is down.

Do you mean by this that the switches are *electrically *in parallel? That is, a wired-or circuit?

Yes, i wired the switches in parallel because they both mean the same thing, stop. So I thought it could be an interrupt, but as I looked over interrupts, I didn't see how. The two switches will be hit by a lever that closes them as the motor turns to the proper position.

Either let the swiches cut off motor power or check switches before each puls of stepping.

LearningIsFun:
Yes, i wired the switches in parallel because they both mean the same thing, stop. So I thought it could be an interrupt, but as I looked over interrupts, I didn't see how. The two switches will be hit by a lever that closes them as the motor turns to the proper position.

You will not need interrupts or count stepper steps.
You switches do not mean STOP?

The top limit means the aerial is UP. the bottom limit means the aerial is DOWN.
Wire the two as separate inputs and then write your code.
The switches do not mean STOP your code will interpret the STOP.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Thanks.. Tom... :slight_smile: