sparkfun nRF24L01+ Скачать руководство пользователя страница 5

n Circuit Assembly

Repeat!

Since these are radio modules, you’ll need 

at least two

modules to talk to 

each other. Duplicate the connections between another Redboard and 
n module. Don’t forget to attach the antenna to your n 
if you have the RP-SMA version.

Arduino Code

There are a lot of libraries available for this module, but we recommend 
using the RF24 library, originally written by maniacBug, and updated for 
Arduino 1.6x by TMRh20.

You can find the most up-to-date version of the library here. Alternatively, 
you can download this zip and install it into your Arduino IDE libraries 
folder. If you need help with the library installation, please check out our 
tutorial.

DOWNLOAD THE RF24 LIBRARY

Once you have your code properly installed, open up 

Examples 

 RF24 

 

GettingStarted.ino

.

Check out the User Configuration section of the code, and make sure you 
update yours as shown below.

/****************** User Config ***************************/
/***      Set this radio as radio number 0 or 1         ***/
bool radioNumber = 1;

/* Hardware configuration: Set up nRF24L01 radio on SPI bus pl
us pins 9 & 10 */
RF24 radio(9,10);

One radio should have the 

radioNumber

set to 

0

and the other should be 

set to 

1

.

Upload the code to your Redboards. Once you have them both set up, you 
can open up two terminals set at 115200 bps, 8-N-1, and you should see 
the following appear on the terminal.

RF24/examples/GettingStarted 
*** PRESS 'T' to begin transmitting to the other node

Press 

T

in one terminal, press 

R

in the other, and wait until you start 

seeing your radios communicating! You should see something similar in 
your terminal.

Page 5 of 6

Отзывы: