Arduino Forum

Topics => Robotics => Topic started by: kanaramkhator on Feb 25, 2016, 07:39 pm

Title: Stepper motor
Post by: kanaramkhator on Feb 25, 2016, 07:39 pm
I am using a stepper motor that rotates one complete revolution in 200 pulses means 200 steps per revolution. now I want it to run 50000 revolution. can I use such big integer (i.e. 200*50000) in arduino, please put your opinion, I really need some expertise.
Title: Re: Stepper motor
Post by: jremington on Feb 25, 2016, 08:35 pm
Use long integer variables. Long integer constants are identified with an "L" after them, e.g. 100000L.
Title: Re: Stepper motor
Post by: kanaramkhator on Feb 26, 2016, 12:10 pm
Thanx, anything more if u want to add to it, your welcome.....
Title: Re: Stepper motor
Post by: MRMAINT62 on Feb 29, 2016, 12:42 pm
If using long integers is not enough, then don't count all of that movement in pulses. Count pulses for each 200 in a revolution, then start over counting the pulses for the next revolution and keep track of the total number of revolutions with a second variable.