Hello All,
Im facing a strange issue i connected my NRF240L1+PA/LNA CE Pin to 7 and CSN pin to 8 of my Arduino UNO, but while i configure RF I have to assign CSN pin first and CE second,
but in docs should CE pin on first and CSN on second.
this is how my RF is working
// Instantiate RF24 class with CE and CSN values
RF24 radio(8, 7);
this is how explain in Document
// Instantiate RF24 class with CE and CSN values
RF24 radio(7, 8);
this is code which i used for testing
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
// Instantiate RF24 class with CE and CSN values
RF24 radio(8, 7);
// Address to devices comunicate each other (same in both)
const uint64_t pipe = 0xE8E8F0F0E1LL;
// A variable to hold some info
boolean info = false;
void setup() {
// Setup serial output
Serial.begin(9600);
// Start RF
radio.begin();
// Setup the channel to work within, number 100
radio.setChannel(100);
// Open wite pipe
radio.openWritingPipe(pipe);
}
void loop() {
// it changes every interval
info = !info;
if (info) {
Serial.print("Sending positive... ");
} else {
Serial.print("Sending negative... ");
}
// Send info over RF
bool success = radio.write(&info, sizeof(boolean));
if (success) {
Serial.println("sent!");
} else {
Serial.println("fail!");
}
// Wait 2 seconds and repeat
delay(1000);
}