Greetings,
I am very new at this so please be patient with me.
What I am trying to do:
I am using two Arduino Uno's and two nRF24L01 modules to light up an LED on the rx side when a button on the tx side is pressed. I followed the tutorial that you always post in them forms:
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
as well as many others including this link, which includes that library that I am using as the tmrh20 library has not worked for me
:
Problems:
My main issue right now is that using the library from the instructables tutorial, I get at least a delay of one second for the LED to turn off after the button has been pressed, which I have no idea why. I have done my research and banged my head against this for over two weeks now. The delay is completely unacceptable for the research purposes that I am trying to use this for, and this does not seem to be a common complaint.
As to why the tmrh20 library is not working, I have no idea. It allows the LED to light up randomly when the button is not pressed and does not turn it off sometimes. Also, I am using the latest version of Arduino IDE (ver 1.8.3).
I also don't think that this is a pin connection issue as I am using the following pin connections as shown in this link:
http://shanes.net/simple-nrf24l01-with-arduino-sketch-and-setup/
The tx code that I am using:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int SW1 = 7;
void setup(void){
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);}
void loop(void){
if (digitalRead(SW1) == HIGH){
msg[0] = 111;
radio.write(msg, 1);}}
The rx code that I am using:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;
void setup(void){
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
pinMode(LED1, OUTPUT);}
void loop(void){
if (radio.available()){
bool done = false;
while(!done){
done=radio.read(msg, 1);
Serial.println(msg[0]);
if (msg[0] == 111){/delay(10)/;digitalWrite(LED1, HIGH);}
else {digitalWrite(LED1, LOW);}
/delay(10)/;
}}
else{Serial.println("No radio available");}
;}
which as you can see, I commented out the delays in the code as there are none in the libraries, just to see if that fixed my issue. However, this did not change anything.
The one thing that I have seen other people do is to solder on some 10microF capacitors and the only reason that I have not done this is that I do not think this issue is power related. The people that seem to do it, just do it automatically because it is what others suggest doing.
Do you think I should go ahead and order a soldering iron so that I can place capacitors on my modules or do you agree that this issue is not power related? Also have you seen this issue before and what do you suggest I do?
Thank you!