Hi,
I have an arduino UNO board with 2 step motor controler "TB6600 4.5A CNC"
I already can drive the step motor into one direction and I need a code with the following tasks:
1. Input 1 hast to be active
2. Output 2 HIGH (Relais module)
3. Step motor 1 (Output 3,4) should start for "20mm" or 1 second with a variable speed
4. delay 1000
5. Output 2 LOW
6. Output 7 HIGH
7. Step motor 2 (Output 5,6) start for "10mm" or 0,5 second with a variable speed
8. Step motor 2 has to move back with a variable speed
9. Output 7 LOW
10. Output 2 HIGH
11. Step motor 1 has to move back with a variable speed
12. Output 2 LOW
13. Output 8 HIGH
14. Delay 200
15. Output 8 LOW
END IF (inpuit)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The step motor was working with this code at 8-9
#include <AccelStepper.h>
// Define a stepper motor 1 for arduino
// direction Digital 9 (CW), pulses Digital 8 (CLK)
AccelStepper stepper(1, 8, 9);
void setup()
{
// Change these to suit your stepper if you want
[login to view URL](1000);//1100
[login to view URL](1100);
[login to view URL](2000);
}
void loop()
{
// If at the end of travel go to the other end
if ([login to view URL]() == 0){
[login to view URL]( [login to view URL]() );
}
[login to view URL]();
}
I hold master degree in Instrument Tech and having about 35 years of expertise in real time embedded hardware and software applications. I am well versed with stepper motor and Arduino board programming.