Skip to content

Instantly share code, notes, and snippets.

@elktros
Created July 20, 2018 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elktros/9928d58b54c917dee36b4b51313369af to your computer and use it in GitHub Desktop.
Save elktros/9928d58b54c917dee36b4b51313369af to your computer and use it in GitHub Desktop.
Receiver Code for Basic Wireless Communication between two Arduino boards using nRF24L01 Transceiver Modules.
/* Receiver */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN Pins
const uint64_t address = 0xF0F0F0F0E1LL;
void setup()
{
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop()
{
if (radio.available()) {
char recvData[32] = "";
radio.read(&recvData, sizeof(recvData));
Serial.println(recvData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment