TB6600 4A 9-42V MicroStep Stepper Motor Driver (Metal Case)


70 ₪

الناشر: متجر القطع الالكترونية

القسم: محركات - متور

تاريخ النشر: 2025-05-15




connect to ESP32

محتويات

- code with esp






code with esp

code
نسخ
اقتباس
عرض
تنزيل
	
								
// Pin configuration int PUL = 25; // Pulse pin int DIR = 26; // Direction pin int ENA = 27; // Enable pin void setup() { Serial.begin(115200); // Start serial communication pinMode(PUL, OUTPUT); pinMode(DIR, OUTPUT); pinMode(ENA, OUTPUT); digitalWrite(ENA, LOW); // Enable driver (some drivers may need LOW to enable) Serial.println("Stepper motor control started..."); Serial.println("Microstepping: 1/8 (SW1=ON, SW2=OFF, SW3=OFF)"); Serial.println("Running forward and backward..."); } void loop() { // Move forward Serial.println("Moving forward..."); digitalWrite(DIR, LOW); // Set direction forward for (int i = 0; i < 1600; i++) { // 1 full revolution (200 steps * 8 microsteps) digitalWrite(PUL, HIGH); delayMicroseconds(500); // Adjust speed here digitalWrite(PUL, LOW); delayMicroseconds(500); } delay(1000); // Pause between directions // Move backward Serial.println("Moving backward..."); digitalWrite(DIR, HIGH); // Set direction backward for (int i = 0; i < 1600; i++) { digitalWrite(PUL, HIGH); delayMicroseconds(500); digitalWrite(PUL, LOW); delayMicroseconds(500); } delay(1000); }


سلة المشتريات افراغ السلة