Hey all I recently bought this little L293 driver break out board for stepper motors. I've used stepper shields before but am having a hard time wiring this thing up to work with the AFMotor Library.
So I mapped my stepper wires to the Motor A (1&2) inputs and B(1&2) inputs no problem.
I pried open the AFMotor library and found it uses pins 2&3 and 1&4 for stepper #1.
I hooked up those pins on the arduino to the break-out pins and gave a very simple test run. I get a clunk sound instead of any rotation.
What I see are an LED lighting up on the A & B sides (so two LEDs are lighting up). But not all four. When I power down the board and external supply and spin the motor by hand I see all four lighting up.
I'm not sure exactly where to go from here. I notice there are EN1 and EN2 pins on the break-out board, should I be calling those as pullup and writing to them before trying to drive the stepper? I do not understand why there are two pins per ENX outlet when the L293 only has one latch? Any help appreciated.
If you want to see my code here it is -
#include <AFMotor.h>
int stepType = SINGLE;
AF_Stepper xmotor(200, 1);
void setup() {
// put your setup code here, to run once:
//xmotor.setSpeed(40);
}
//Off by facot of 1.789???
void loop() {
xmotor.step(150, BACKWARD, stepType);
delay(2000);
xmotor.step(150, FORWARD, stepType);
delay(2000);
}
Now when I supply power to the leonardo either via USB or external the RX & TX lights do not blink. They remain locked on. When I hit the reset button they turn off momentarily only to be stuck on again. USB doesn't recognize the board either.
Reading the Leonardo pin-out it says "Do Not Use" for digital Pin 1.
This is a huge disappointment. I still do not know how to solve the problem so I'm not sure what to do. Can anyone guide me on the following questions...
Did I hose the arduino?
What did I do wrong?
What is a cheap and reliable board/library to drive stepper motors using another arduino?
A little update. I plugged the motor and power supply into a different L293d shield using an uno and the motor worked completely fine. So it was not the connections from the shield to the motor, nor the power supply.
Something went wrong with how I had connected the Deek Robot shield to the board. Or the way I had the firmware/AFMotor library trying to drive the board. I have no idea which, either way I think my leonardo is toast :(.
That just refers to something called "MicroManager". The footnote explains that it needs to use those pins.
A little update. I plugged the motor and power supply into a different L293d shield using an uno and the motor worked completely fine. So it was not the connections from the shield to the motor, nor the power supply.
It sounds like you changed two things - the shield and the Arduino. How can you tell where the problem was?
On an Uno pins 0 and 1 are Rx and Tx that communicate with the PC over USB, including when programs are uploaded. The Leonardo is different and its pins 0 and 1 have nothing to do with program uploading. Beyond that I do not know enough to have an opinion about whether you have damaged your Leonardo. But I would be surprised if using pins 0 and 1 were directly the cause of the damage.
Yea Robin like I said I have no way to figure out the problem. The leonardo is dead. However, that showed that the motor, powersupply, and code were working. The problem is that I have no idea. I thought I did everything correctly, it even sounded like the motor should have been working.
I'm beginning to wonder if the Deek Robot chip itself is flawed. The only other thread I could find on it on this website or anywhere was someone who stopped responding. It's possible they had the same issue. I did notice that the voltage regulator on the arduino board got very very hot at one point. I'm wondering if the 12V was getting dumped back onto the board somehow?