Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@elktros
Created July 20, 2018 10:48
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/fdec4ec6b9bf7b3d8c138fabf2896710 to your computer and use it in GitHub Desktop.
Save elktros/fdec4ec6b9bf7b3d8c138fabf2896710 to your computer and use it in GitHub Desktop.
Transmitter Code for Basic Wireless Communication between two Arduino boards using nRF24L01 Transceiver Modules.
/* Transmitter */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN Pins
const uint64_t address = 0xF0F0F0F0E1LL;
void setup()
{
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop()
{
const char sendData[] = "This is a test!";
radio.write(&sendData, sizeof(sendData));
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment