Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code to test nRF24L01 with Arduino (Receiver)
* AJ Alves (
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// Instantiate RF24 class with CE and CSN values
RF24 radio(9, 10);
// 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
// Start RF
// Setup the channel to work within, number 100
// Open recept pipe
radio.openReadingPipe(1, pipe);
// Start to listen
void loop() {
// Wait until some data
if (radio.available()) {
// Read payload, and check if it finished, sizeof(info));
// Manage info
if (info) {
Serial.println("We received positive!");
} else {
Serial.println("We received negative!");
// Wait a bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.