Arduino Shield CNC Stepper motor Engrenage courroie et mecanique diverse
const int enPin=8; const int stepXPin = 2; //X.STEP const int dirXPin = 5; // X.DIR const int stepYPin = 3; //Y.STEP const int dirYPin = 6; // Y.DIR const int stepZPin = 4; //Z.STEP const int dirZPin = 7; // Z.DIR const int nombredepasH=120; // rapport 60 heure const int nombredepasM=2; int speedoH = 100; //micro s entre les pas... int speedoM = 100; void setup() { pinMode(enPin, OUTPUT); digitalWrite(enPin, LOW); digitalWrite(dirYPin, HIGH); // Enables the motor to move in a particular direction digitalWrite(dirXPin, LOW); // Enables the motor to move in a particular direction } void loop() { for (int i = 0; i < nombredepasM; i++) { digitalWrite(stepYPin, HIGH); delayMicroseconds(speedoM); digitalWrite(stepYPin, LOW); delayMicroseconds(speedoM*10); } for (int i = 0; i < nombredepasH; i++) { digitalWrite(stepXPin, HIGH); delayMicroseconds(speedoH); digitalWrite(stepXPin, LOW); delayMicroseconds(speedoH*10); } }