|
Re: Motor moving by degree amounts with a button
In past years, our team has used a potentiometer for such a task. Have it connected in some way to the shaft of whatever it is you are having your motor turn, then read the voltage output in your code (analogue input). Take a few voltage readings at different degrees, then plot those points in a scatter plot in excel (x values would be the voltages, y values would be the degrees (you can choose what angle is 0 of course). Fit a trend-line to the data, and just incorporate the line's equation into your code. Easy conversion of pot voltage into degrees. There are other sensors that do a similar same thing, such as the encoder. Good luck!
Note: What I described only gives you the current "degree" of the object being rotated. You would need to determine how to take that data and make the motor turn (which way, what speed, for how long, etc)
|