hello, I'm currently building a maze runner robot. it is supposed to work with 4 dc motors, I'm using an Arduino Uno and a motor shield attached to it. I plugged the 4 motors into the motor shield and burned the following code to the Arduino:
the duplication was an innocent mistake because I did too many edits on the code while I was trying to get the motors to run
however now I'm just trying to get all 4 dc motors to run before working on the maze algorithm
I did wire one motor and changed between the channels only channel 2 and 3 are working.
when I plugged the motor which was in channel 4 into channel 3 it moved poorly and slow and stopped for a long time then it started to run again
I don't know if there is a faulty in the motor shield or the dc motors or the code or I should just provide 2 more batteries and connect them to the shield
@hixoop I would suggest that you try and identify a working channel and a working motor. Then use that working motor to determine which other channels are working correctly.
I'm not sure why @wildbill thinks you are using pin 1 of the Arduino (which is used for serial comms). I found a schematic for what might be the correct/similar motor driver board and it doesn't use the serial pins at all.
Assuming that channel 2 & 3 refer to M2 and M3 on the board, they are on separate driver chips.
If you suspect that there may be a fault with the driver chips, then by the looks of your photo, the chips are in DIL sockets. You could try removing the 2 driver chips and swapping them over to see if channels 2 and 3 still work.
If you just have the code for 1 motor on channel 1, does that work? (Trying to establish if it's a channel fault or an issue to do with using multiple motors).
Are you using the correct library to drive the board? The Adafruit website shows a v1 motor driver shield that they no longer make which looks very similar to yours.
Ok, if you are sure that the library you are using matches the board that you have, then there could be an issue with the L293D driver chips.
But first, I would triple check the library/board compatibility as it could easily go wrong if the shift register outputs on the driver board don't match the pin definition in the library.