//Stepper_1 tour pas à pas 180218 //Vient des Exemples de l'IDE Arduino //Attention!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //Connecter le fil bleu à D8 //le fil jaune à D9 //le fil rose à D10 //le fil orange à D11 /* Stepper Motor Control - one step at a time This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor will step one step at a time, very slowly. You can use this to test that you've got the four wires of your stepper wired to the correct pins. If wired correctly, all steps should be in the same direction. */ //Moteur 28BY H 48, 8 dents , 4steps par tour soit 32steps/tour, 11.25° /step //MAIS reduction mecanique de 64 donc il faut 32*64= 2048 steps /tour d'axe externe //freq max 100Hz soit 10ms /step mini, 20480ms/tour au plus vite: 20s/t = 3 tr/mn max //en pratique, supporte 14t/mn grand maximum! //OK via USB, 200mA #include const int stepsPerRevolution = 2048; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); int stepCount = 0; // number of steps the motor has taken void setup() { // initialize the serial port: Serial.begin(9600); } void loop() { // step one step: myStepper.step(1); Serial.print("steps:"); Serial.println(stepCount); stepCount++; delay(10); }