nope, its 200 steps per rev, 1/6 raito, = 1200 steps per rev total, i did not see the need for the code to do that math, so i just enter 1200 for steps and 1 for raito, ive tried the math for all my driver settings, and always get a 1/3 or 2/3 decimal.
the code works for you and goes in reverse ?
thats the only thing i actually want at this point, i got it installed on the mill and cut a 5 and 6 sided reamer's
Works fine FWD and REV . . . [Note - 276 referred to your post number not script line number] You should be able to change the numbers if your full stepping 200 for StepsPerRotation, 400 for half stepping [runs smoother on half stepping
Ok after the Bride lets me free I'll do a quick and dirty test script for FWD and REV - I'll Be Back . .
Back - Should run motor fwd and rev -
#include <LiquidCrystal_I2C.h>
#include <LiquidCrystal_I2C.h>
int stp = 2;
int dir = 3;
int stepdelay = 2000; // Reduce number to speed up motor
int revolution = 400; // Half Stepping - Set TB6600 switches accordinly ie: 1 OFF, 2,3 ON
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
void setup() {
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
lcd.begin(20,4);
}
void loop() {
delay(500);
digitalWrite(dir,HIGH);
lcd.setCursor(6,2);
lcd.print("Forward");
for (int x = 0; x < revolution; x++)
{
digitalWrite(stp, HIGH);
delayMicroseconds(stepdelay);
digitalWrite(stp, LOW);
delayMicroseconds(stepdelay);
}
delay(500);
digitalWrite(dir,LOW);
lcd.setCursor(6,2);
lcd.print("Reverse");
for (int x = 0; x < revolution; x++)
{
digitalWrite(stp, HIGH);
delayMicroseconds(stepdelay);
digitalWrite(stp, LOW);
delayMicroseconds(stepdelay);
}
}
int stp = 2;
int dir = 3;
int stepdelay = 2000; // Reduce number to speed up motor
int revolution = 400; // Half Stepping - Set TB6600 switches accordinly ie: 1 OFF, 2,3 ON
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
void setup() {
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
lcd.begin(20,4);
}
void loop() {
delay(500);
digitalWrite(dir,HIGH);
lcd.setCursor(6,2);
lcd.print("Forward");
for (int x = 0; x < revolution; x++)
{
digitalWrite(stp, HIGH);
delayMicroseconds(stepdelay);
digitalWrite(stp, LOW);
delayMicroseconds(stepdelay);
}
delay(500);
digitalWrite(dir,LOW);
lcd.setCursor(6,2);
lcd.print("Reverse");
for (int x = 0; x < revolution; x++)
{
digitalWrite(stp, HIGH);
delayMicroseconds(stepdelay);
digitalWrite(stp, LOW);
delayMicroseconds(stepdelay);
}
}