hwthinker icon

Nano nRF24L01 - Receiver

hwthinker | PRO | 05/17/21 07:33:22 AM UTC | 0 ⭐ | 1444 👁️ | Never ⏰ | []
Arduino |

430 B

|

None

|

0 👍

/

0 👎

// receiver
#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.startListening();
}
 
void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

Comments