Anonymous User
setup electronik August 23, 2009 06:47PM |
Re: Need help for control two stepper motors! August 23, 2009 08:25PM |
Registered: 15 years ago Posts: 300 |
Anonymous User
Re: Need help for control two stepper motors! August 24, 2009 07:11AM |
Anonymous User
Re: Need help for control two stepper motors! August 24, 2009 12:10PM |
Anonymous User
Re: Need help for control two stepper motors! August 25, 2009 06:58PM |
Re: Need help for control two stepper motors! August 26, 2009 05:40AM |
Admin Registered: 17 years ago Posts: 7,879 |
void loop() { int t_end=1000000; int s1_steps=10000; int s2_steps=20000; int t1 = t_end/s1_steps; //Delay between steps of the first motor int t2 = t_end/s2_steps; //Delay between steps of the second motor int c1 = 0; //The counter of idle time of the first motor int c2 = 0; //The counter of idle time of the first motor long t_total = 0; //Time from the operation beginning while (t_total++ < t_end) { if (++c1 == t1) { digitalWrite(s1_stepPin, HIGH); c1 = 0; } if (++c2 == t2) { digitalWrite(s2_stepPin, HIGH); c2 = 0; } delayMicroseconds(1); digitalWrite(s1_stepPin, LOW); digitalWrite(s2_stepPin, LOW); delayMicroseconds(1); } }
Anonymous User
Re: Need help for control two stepper motors! August 26, 2009 10:24AM |