Good day,
I have been working on a project to have a control glove send data to a central Arduino in order to play a corresponding sound. Currently I am using 1 Arduino nano with a NRF24L01+ module to transmit test data and a second Arduino nano with a NRF24L01+ to receive the data. This second Arduino is also use an MicroSD card breakout from adafruit and a 8ohm speaker.
I had this setup successfully working, however now the receiving module is not being seen by the Arduino. I have attempted to replace both the Arduino and NRF24L01+ module. I have also reverted the code to a state that did work and still having the error.
Currently im hitting the “Radio initialization failed!”
Any constructive criticism is welcome. I plan on using this forum more and would like to make valuable posts.
The pin out for The NRF24 and sd module…
| NRF24 | | |#| | SD |
| - | - | - | - |
| GND | GND | |#| | 5V | 5V |
| VCC | 3.3V | |#| | GND | GND |
| CE | D7 | |#| | CLK | D13 |
| CSN | D8 | |#| | DO | D12 |
| SCK | D13 | |#| | DI | D11 |
| MOSI | D11 | |#| | CS | D10 |
| MISO | D12 | |#| |
The speaker is using GND and D9
#include <SPI.h>
#include <RF24.h>
#include <nRF24L01.h>
#include "TMRpcm.h"
//SD config
#define SD_ChipSelectPin 10
//Radio Config
RF24 radio(7 , 8); // CE, CSN
const byte address[6] = "00001";
//Speaker Config
TMRpcm tmrpcm;
void setup() {
Serial.begin(9600);
//Radio Setup
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
//SD Setup
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD initialization failed!");
while (1);
}
else {
Serial.println("SD initialization done.");
}
//Radio Setup
if (!radio.available()){
Serial.println("Radio initialization failed!");
while (1);
}
else {
Serial.println("Radio initialization done.");
}
//Speaker Setup
tmrpcm.speakerPin = 9;
tmrpcm.setVolume(3);
}
void loop(){
//Listneing on the radio
char gloveInput[32] = "";
radio.read(&gloveInput, sizeof(gloveInput));
//Testing to see the data coming in
Serial.println(gloveInput);
//Play Sound based on input
if(strcmp(gloveInput,"rightOne")==0){
tmrpcm.play("Lycoris_Hello.wav");
}
if(strcmp(gloveInput,"rightTwo")==0){
tmrpcm.play("Lycoris_Yes.wav");
}
if(strcmp(gloveInput,"rightThree")==0){
tmrpcm.play("Lycoris_No.wav");
}
if(strcmp(gloveInput,"rightFour")==0){
tmrpcm.play("Lycoris_GoodBye.wav");
}
if(strcmp(gloveInput,"leftOne")==0){
tmrpcm.play("Lycoris_Hug.wav");
}
if(strcmp(gloveInput,"leftTwo")==0){
tmrpcm.play("Lycoris_Picture.wav");
}
if(strcmp(gloveInput,"leftThree")==0){
tmrpcm.play("Lycoris_Help.wav");
}
if(strcmp(gloveInput,"leftFour")==0){
tmrpcm.play("Lycoris_Introduction");
}
}