Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//RECEIVE - ARDUINO UNO
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
RF24 radio(9,10);
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
void setup(void)
{
Serial.begin(57600);
radio.begin();
radio.setRetries(15,15);
radio.openReadingPipe(1,pipes[1]);
radio.startListening();
radio.printDetails();
radio.openWritingPipe(pipes[1]);
radio.openReadingPipe(1,pipes[0]);
radio.startListening();
}
void loop(void)
{
Serial.println("loop");
if ( radio.available() )
{
unsigned long data = 0;
radio.read( &data, sizeof(unsigned long) );
Serial.println(data);
}
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment