Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF-Nano Operating Instruction PDF - Pin Error! #23

Open
LK-Simon opened this issue Aug 24, 2021 · 3 comments
Open

RF-Nano Operating Instruction PDF - Pin Error! #23

LK-Simon opened this issue Aug 24, 2021 · 3 comments

Comments

@LK-Simon
Copy link

Page 8 of RF-NANO Operating Instruction_V.1.1.pdf contains an error in the text, which will cause endless headaches for developers trying to use the nRF24L01+ radio.
the CE and CSN pins are reversed!

D10 is CSN
D9 is CE

The manual should be updated to reflect this.

@S1L3NTANG3L
Copy link

@LK-Simon Wish I knew this 3 days ago XD, althoug I still can't get it to talk to a normal nRF24L01+ module, you got any code you know for a fact works? Starting to think one of my two boards is a dud...

@LK-Simon
Copy link
Author

@LK-Simon Wish I knew this 3 days ago XD, althoug I still can't get it to talk to a normal nRF24L01+ module, you got any code you know for a fact works? Starting to think one of my two boards is a dud...

Hi, @S1L3NTANG3L, I actually published an article on this with a full code example project here. You can use this as a basis for your own implementation :)

@S1L3NTANG3L
Copy link

@LK-Simon I followed your code but can't seem to get mine initialised?? Mind having a look at the code?
`#include <DHT.h>
#include <RF24.h>
#include <nRF24L01.h>
#include "LowPower.h"
#include <printf.h>
#include <stdio.h>

#define PIN_RF24_CSN 10
#define PIN_RF24_CE 9

#define NRF24_DATA_RATE RF24_2MBPS
#define NRF24_PA_LEVEL RF24_PA_MAX
#define NRF24_RETRY_DELAY 2
#define NRF24_RETRY_COUNT 5

#define CHANNEL_READ 987654321
#define CHANNEL_WRITE 123456789

RF24 radio(PIN_RF24_CE, PIN_RF24_CSN);
DHT dht(2, DHT11);
bool radioReady = false;

struct Reading{
float temp;
float hum;
};

void setup() {
Serial.begin(115200);
printf_begin();
int failCount = 0;
while (!radioReady)
{
radioReady = radio.begin();
if (!radioReady) {
failCount++;
Serial.print("Radio Initialisation Failed ");
Serial.print(failCount);
Serial.println(" times.");
delay(1000);
}
}
if (!radioReady) {
Serial.println("Radio could not be initialised!");
return;
}
else
{
Serial.println("Radio initialised!");
return;
}
radio.setAutoAck(false);
radio.setPALevel(NRF24_PA_LEVEL);
radio.setRetries(NRF24_RETRY_DELAY, NRF24_RETRY_COUNT);
radio.setDataRate(NRF24_DATA_RATE);
radio.setPayloadSize(sizeof(Reading));
radio.openReadingPipe(1, CHANNEL_READ); // For Incoming Data
radio.openWritingPipe(CHANNEL_WRITE); // For Outgoing Data
radio.printDetails();

}

void loop() {
dht.begin();
Reading currentReading;
currentReading.temp = dht.readHumidity();
currentReading.hum = dht.readTemperature();
Serial.println("Temp: " + String(currentReading.temp) + " Hum: " + String(currentReading.hum));
if (!radio.write(&currentReading, sizeof(Reading)))
{
Serial.println("Transmission failed!"); // We output errors to Serial.
}
delay(150);
LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants