Go Down

Topic: Serial degrees (Read 1 time) previous topic - next topic


I think I'm in the right forum.
I have a stepper motor that I hooked up to a pot, I now want to set up the serial to read in 360 degrees. I looked in the libraries, and I did not find anything, I tried google, but I don't think I'm searching the right parameters, as I get nothing of use. Any one know keywords for a search, or can point me in the right direction?


Sorry I don't understand what you mean by:-
to set up the serial to read in 360 degrees.


I would like to read the motor as it turns to read 360 degrees. I want to know what the position is on the motor for reference.


The map(); function will help you.
Perseverance is 90% of the solution. The remaining 10% is more perseverance.


So I think you want to output a number in degrees to the serial port.
This depends on how many steps your motor takes to complete one revolution. If it is a 200 step motor this means that each step is 1.8 degrees.
So simply multiply the number of steps the motor has taken by 1.8. Note that this will mean converting the variables into the float type.
Code: [Select]

float degrees = (float)numberOfSteps * 1.8;


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131