bonjour A tous
voila j'avance un peu dans mon projet et j'ai récupéré 2 micro strep driver et j'en ai cablé 1 pour tester directement mon moteur pas a pas avec ce code :
//Arduino Sketch based on easy driver
int dirpin = 8;
int steppin = 9;
int enable = 7;
void setup()
{
pinMode(dirpin, OUTPUT);
pinMode(steppin, OUTPUT);
digitalWrite(enable, HIGH);
}
void loop()
{
int i;
digitalWrite(dirpin, HIGH); // Set the direction.
delay(5000);
for (i = 0; i<400; i++)
// Iterate for 4000 microsteps.
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
delayMicroseconds(3500);
digitalWrite(steppin, HIGH);
delayMicroseconds(3500); // This delay time is close to top tspeed for this
}
// particular motor. Any faster the motor stalls.
digitalWrite(dirpin, LOW); // Change direction.
delay(5000);
for (i = 0; i<400; i++)
// Iterate for 4000 microsteps
{
digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
delayMicroseconds(3500);
digitalWrite(steppin, HIGH);
delayMicroseconds(3500); // This delay time is close to top speed for this
}
// particular motor. Any faster the motor stalls.
}
et le moteur tourne bien dans 1 sens et 1 autre.
je suis repassé avec le code grbl dans l'arduino et j'ai lancé la commande G1 X5 Y0 Z0 voila le résultat :
Grbl 1.1e ['$' for help]
[HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $SLP $C $X $H ~ ! ? ctrl-x]
ok
ok
error:22
ok
qui peut m'aider svp ?
merci