Created
January 10, 2014 05:05
-
-
Save shnae/8347305 to your computer and use it in GitHub Desktop.
A very basic send test for Arduino with nrf24l01
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
#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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!