Sets the two pins as Outputs pinMode(stepPin, OUTPUT) ĭigitalWrite(dirPin, HIGH) // Enables the motor to move in a particular direction // Makes 200 pulses for making one full cycle rotation for( int x = 0 x < 200 x++) Code language: Arduino ( arduino ) Categories Arduino Tutorials */ // defines pins numbers const int stepPin = 3 * Simple Stepper Motor Control Exaple Code In our case they are the pins number 3 and 4 on the Arduino Board and they are named stepPin and dirPin and the setup section we have to define them as an outputs. First we have to define the Step and Direction pins. ![]() I will use a NEMA 17 bipolar Stepper Motor and its wires A and C will be connected to the pins 1A and 1B and the B and D wires to the 2A and 2B pins. Also I will use a 100♟ capacitor for decoupling and 12V, 1.5A adapter for powering the motor. I will use the drive in Full Step Mode so I will leave the 3 MS pins disconnected and just connect the Direction and the Step pins of the drive to the pins number 3 and 4 on the Arduino Board and as well the Ground and the 5 V pins for powering the board. As an Amazon Associate I earn from qualifying purchases. Amazon / Banggood / AliExpressĭisclosure: These are affiliate links.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |