The evil plan was on power up to rotate the model till it hit a switch that would decide it's home.
Not at the computer that has the code on it right now. Basically I was just sending a high low to pin 13 x number of times on button push. Seems simple but I ran in to two problems doing it this way, one I messed up and only could get 1 of 4 buttons to work .... and the second was while the motor is running how to check the switch to see if it has been pushed again.
I also didn't want to post my code out of embarrassment :-( Somebody with a fresh start might be quicker then trying to understand my lack of logic.
But an earlier comment got me thinking more about a different approache. I think I was doing a lot of unnecessary coding using ifelse... if button is pushed, send 17000 pulses to motor controller, check next button instead of if button is pushed, add to variable... if variable is above 0 send pulses to motor... clear as mud The second problem was making the calls to the switch while the motor was running.... and then my head exploded and figured there was someone out there who would say " oh that's easy" dooh
Not complicated for someone who knows what they are doing.... me not so much. That is why I am looking for someone who is willing to write it up and earn some beer money. I've just gotten too frustrated, and the beer wasn't helping
Set number of steps... 17750 is one quarter turn. So need to track current position and number of steps to next position defined by which button pushed.
The other half is while it is running clockwise or counter clockwise continuously ( as defined by button 5 and 6 ( Which if hit again would stop the motor )) it needs to track the number of steps ( position ) so if one of the four cardinal points are pushed it will go to that location.
The whole idea of the project is they are presenting a building on a turntable.... the model will be slowly rotating, as the presenter says " on the west side " they will hit the button and the unit will rotate to the west side and stop... the presenter will then say " on the North side" hit a button and it will rotate to the north side etc etc... until at such point the presentation ends and the presenter will hit the CW(6) or CCW(5) buttons and the model will just continuously rotate.
I'm finishing up the hardware and I have limited control of the motor with the arduino but not all the functions I want.