I hope this is the right forum. I'm a total newbie at this, so excuse me if I miss something obvious.
I'm attempting to make a basic slide mechanism for an anamorphic lens that goes in front of my projector. To do this, I have purchased the following:
- Arduino Uno R3
- Meanwell 24V 6A PSU (LRS-150-24)
- TB6600 stepper motor driver (Link)
- Slide mechanism with motor (Link)
I spent some time with the Arduino kit I ordered doing some basic things, like making LEDs turn on/off based on inputs, reading the serial output, etc. I even got it to react based on an IR input.
I just received my motor driver, however, and am currently attempting to get the motor to move. Unfortunately, absolutely nothing is happening. Everything appears to be wired correctly (I even corrected for the swapped A/B pins on these drivers), but running the code does nothing but make a green LED on the motor driver blink. I've also confirmed that the PSU is indeed supplying the correct 24V.
I'm honestly at my wit's end with this.
Here's example code I'm running
// defines pins numbers
const int stepPin = 3;
const int dirPin = 2;
const int enPin = 1;
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 to 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); a
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delaydigitalWrite(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);}