I specifically had saved code for the purpose of checking the connection, but it doesn't seem to work anymore.
All the examples from this simple tutorial work, so it can't be a hardware issue.
Maybe someone can find a reason why the code wouldn't work? It returns radio.available() as false
//Transmitter
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};
float valueTransmit;
float valueRecieved;
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(addresses[1]); // 00002
radio.openReadingPipe(1, addresses[0]); // 00001
radio.setPALevel(RF24_PA_LOW);
valueTransmit = 0
}
void loop() {
radio.stopListening();
radio.write(&valueTransmit, sizeof(valueTransmit));
delay(5);
radio.startListening();
if (radio.available() ) {
radio.read( &valueRecieved, sizeof(valueRecieved) );
Serial.print(valueRecieved);
valueTransmit = valueRecieved + 0.01;
}
}
//Reciever
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};
float valueTransmit;
float valueRecieved;
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(addresses[0]); // 00001
radio.openReadingPipe(1, addresses[1]); // 00002
radio.setPALevel(RF24_PA_LOW);
}
void loop() {
radio.startListening();
if (radio.available() ) {
radio.read( &valueRecieved, sizeof(valueRecieved) );
Serial.print(valueRecieved);
valueTransmit = valueRecieved + 1;
}
radio.stopListening();
radio.write(&valueTransmit, sizeof(valueTransmit));
delay(5);
}
suddenly not working
means that it was working and it failed without any changes ... is that what happened?