Skip to content

Instantly share code, notes, and snippets.

@shnae
Created January 10, 2014 05:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shnae/8347305 to your computer and use it in GitHub Desktop.
Save shnae/8347305 to your computer and use it in GitHub Desktop.
A very basic send test for Arduino with nrf24l01
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
/*
this is the most basic sketch I can think of to transmit data from an nrf24l01.
It loops over the numbers 0-255 continuously and sends each number to the receiving
unit. I have used this pattern as a test to check for drops in the signal by
checking the receiving end for gaps between numbers. It's not sophisticated,
but it seems to work.
*/
void setup(void){
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);}
void loop(void){
for (int x=0;x<255;x++){
msg[0] = x;
radio.write(msg, 1);
}
}
@Socasx7
Copy link

Socasx7 commented Apr 8, 2016

Newbie here.
Doing the god's work out there!
Also it would be amazing if you could tell, what these functions(radio.write) EXACTLY do, in simple words, the one's you use.
Thanking Ya!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment