Created
July 20, 2018 10:48
-
-
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.
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
/* 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