01-15-2015 07:01 PM
i. we are trying to program a 6th moter to turn only 30 degrees, then turn back to its original position. We have never used a button on the joystick to do this. Can anyone give us the full code for this?
01-16-2015 02:11 PM
Can you explain a bit more about what you are trying to do? I presume you mean a DC motor and you are looking to turn it X degrees (90, 180) etc. If so, why are you using a DC motor instead of a servo? DC motors are not really intended to reliably move a certian numebr of degrees.
01-19-2015 04:33 PM
If you are using a DC Motor, you could get some pretty good results using an attached encoder. There's an encoder tutorial here:
Otherwise, I agree with Eddie that a servo would work better in this case as servos are designed to move to precise positions. A stepper motor might serve well too. You could figure out how many steps it took to move 30 degrees and hard-code that number.