Created
July 20, 2018 10:49
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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