figleymigley (figleymigley) wrote,

Биполярный шаговый двигатель EM-257

Пример из библиотеки Stepper:

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.

Use this also to count the number of steps per revolution of your motor,
if you don't know it. Then plug that number into the oneRevolution
example to see if you got it right.

Created 30 Nov. 2009
by Tom Igoe


#include <stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 30 through 33:
Stepper myStepper(stepsPerRevolution, 30,31,32,33);

int stepCount = 0; // number of steps the motor has taken

void setup() {
// initialize the serial port:

void loop() {
// step one step:
for (int i=0; i< 100; i++) {
delay (20);
Serial.print("steps:" );

проверял с шаговиком от принтера Epson, EM-257, подключено по схеме со стр. 13 файла 
L293D + arduino + биполярный шаговый двигатель

Обмотки у него : 1-3, 2-4
Tags: шаговый двигатель

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment