Help DC motor going only one way

You're totally right. I run a part of the code only with the IR sensor and it works, when I start the rfid is when the problem starts. Only I don't know how else to show what I have done, I even did a diagram, may be the rfid is connected in the wrong way, but I'm noy specialized in this field to be able to provide more evidence than a picture or the diagram I did :frowning:

The RFID reader uses the same pins as your motor shield when in SPI mode.
You may need to use the i2c interface instead. That uses pins A4 and A5.

Will defenitely try this since I know think there's something wrong with the nfc reader, thanks for the idea :pray:

That's easy to check. Disconnect the motor shield and connect the RFID reader alone.
Does it work?

It does not work correctly you're right. So I tried a different connection, the I2C but I can't get it to work. I'm stuck :frowning:

Did you check the dip switch settings on the RFID reader?
Look at the link I posted in post#21
It shows how to set the switches and connect it.

yes, i did move them to the proper position, what i find weird is that there are no #define for the pins used for the I2C connection :woozy_face:

It's only this from what I can see

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);

Uno is A4 and A5 for i2c.

And I don't have to declare the pins in the code?? that's a little weird, but I'll try again with that in mind. Thanks :slight_smile:

Wire uses pins A4 (SDA) and A5 (SCL)
.

1 Like

Don't forget the pull up resistors 4K7 from each pin to the voltage of the device you are expecting to use.

so this was the solution, apparently the uno some how "short circuits" with the RFID and the motor shield, so i changed the shield for the L9110s module that doesn't coflict at all and the project worked perfectly. Thanks for all the help. Take away message DO NOT USE an arduinno UNO with a motor shield if you want to use an RFID reader, use an L9110s module