Go Down

Topic: all my nrf24 moduals don't work (Read 132 times) previous topic - next topic

Deamond_hunter

Hi guys, ive resently been buying a few pairs of nrf24 i bought 3  of the small ones and 3 of the ones with antenna, but the first time i used them for a tank project and the worked but then after alot of stress testing to the tank they stopped working i had them connected to 2 arduino unos , but i thout it was the moduls so i bough another pair and nothing i thoght i had bbroken them cuss i like to soden female headers to the 5v regulator modul soy i just got another pair today with female to mail cables and all new so i connect it to my arduino uno and my arduino mega and nothing , they wont reseve nor send data this is the code i use

TX Code
/*
* Arduino Wireless Communication Tutorial
*     Example 1 - Transmitter Code
*               
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}
void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}


RX CODE
/*
* Arduino Wireless Communication Tutorial
*       Example 1 - Receiver Code
*               
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListenAing();
}
void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

so after looking up on the internet i have given up and now i need your help guys

DrAzzy

you talk about 5v - you realize that the NRF24 is a 3.3v device, and you'll damage them if you give them 5v, right? If not, that's probably your problem.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Deamond_hunter


Go Up