So im making a project which includes 2 adafruit motorshield v2.3 each, and nrf pa/lna module all working together on the reciever side. Ideally they should be working right?
Well, when i first tested the setup, the nrf module was giving the desired output even after being connected on top of the, at that time, single stacked shield,
However, today i tried it again, and it stopped working. The nrf module is working fine whne connected directly to the arduino, however when i connect the motorshield and then the nrf module, it dosent recieve any data and gives 0 as output.
Then i tried to simply connect the motorshields using wires, they could be stacked and the stack can be connected using wires to the arduino right?
My connections were:-
However as soon as i connected the SDA and SCL wires to the arduino, the nrf module just froze and stopped giving anyoutput whatsoever, and the moment i remove the pins, it starts working perfectly again.
Whats the problem here, i can provide more info if required....
Had you provided a schematic, as requested in How to get the best out of this forum, this question wouldn't be necessary: what pins are you using for the radio module's CE and CSN?
as you can see from the colour code:-
CE - dig 9
CSN - dig 10
SCK - dig13
MOSI - dig 11
MISO - dig 12
vcc - 5v (PA/LNA with the adapter requires 5v)
gnd - gnd
upon connecting the motor shield and then the nrf module, i ran a test to see if it was a receiver side issue or a transmitter side issue, and it is most definately a receiver side issue because i got this as the output:-
by the way, the code i use to check my nrf modules functionability is this:-
/*
If your serial output has these values same then Your nrf24l01 module is in working condition :
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0f
This code is under public domain
Last updated on 21/08/28
https://dhirajkushwaha.com/elekkrypt
*/
#include <SPI.h>
#include <RF24.h>
#include <printf.h>
RF24 radio(9,10);
byte addresses[][6] = {"1Node", "2Node"};
void setup() {
radio.begin();
radio.setPALevel(RF24_PA_LOW);
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1, addresses[1]);
radio.startListening();
Serial.begin(115200);
printf_begin();
radio.printDetails();
}
void loop() {
// empty
}
and i uploaded it to my setup while the adafruit shield was connected to the arduino using wires and the nrf was connected to the arduino. And i got perfect result. the nrf module is working fine. Which means that my arduino freezes the moment i insert the SDA and SCL pins. that seems to be the real problem. any solutions??
hmmm, That makes sense, although I plan to move the servo using the dedicated servo pins on the motorshield at the top left f the shield, however in my code I have attached it at pin 10
flexServo.attach(10);
should i change it?
also, idk how but when tried attaching the motorshield on top of the arduino and uploaded my code the nrf module was WORKING AGAIN. how does this happen i have no clue, and this time i attached all motors and it was working perfectly.... Praise the Omnissiah.
although, should i make amends in the servo pin or is it alright?