Bảng mạch điều khiển động cơ bước 5v

Sơ đồ kết nối Mạch tinh chỉnh động cơ bước TB6560

/* Kết nối: TB6560 Arduino CLK+ 5 CW+ 2 EN+ 8 CLK- GND CW- GND EN- GND A+ A- B+ B- kết nối với hộp động cơ Điện áp hoạt động: 10-35VDC. */const int stepPin = 5; const int dirPin = 2; const int enPin = 8;void setup() // Sets the two pins as Outputs pinMode(stepPin,OUTPUT); pinMode(dirPin,OUTPUT); pinMode(enPin,OUTPUT); digitalWrite(enPin,LOW); void loop() digitalWrite(dirPin,HIGH); // Enables the motor lớn move in a particular direction // Makes 200 pulses for making one full cycle rotation for(int x = 0; x 800; x++) digitalWrite(stepPin,HIGH); delayMicroseconds(500); digitalWrite(stepPin,LOW); delayMicroseconds(500); delay(1000); // One second delay digitalWrite(dirPin,LOW); //Changes the rotations direction // Makes 400 pulses for making two full cycle rotation for(int x = 0; x 800; x++) digitalWrite(stepPin,HIGH); delayMicroseconds(500); digitalWrite(stepPin,LOW); delayMicroseconds(500); delay(1000);
Hình Mạch tinh chỉnh và điều khiển động cơ cách TB6560





