nRF24L01

MySensors

Build a mesh-enabled radio network between your sensors using the MySensors NRF24L01 Arduino Library. The MySensors website also contains easy-to-follow build instructions and Arduino examples to help you create your own wireless sensors.

AVRLib

An Arduino port of the tinkerer.eu library. It works with the Sparkfun nRF24L01+ modules. Note: This library supports a small (but useful) subset of the features provided by the nRF24L01 chip. Also see github repository

RadioHead

A very full-featured Library with support for many different radios, not just nRF24L01: HERE

RF24

Newly Updated/Optimized (2014) NRF24L01 Library for Arduino, ATTiny, Due, and Raspberry Pi includes features/fixes from various forks and major updates RF24 Repo

Another nRF24L01 library github RF24 repo - This libraries also includes Raspberry Pi libraries/drivers

Mirf

Download -> Mirf.zip Another fork of Mirf that covers attiny cores github repository

Documentation
Pins:
  • MISO -> 12
  • MOSI -> 11
  • SCK -> 13

Configurable:
  • CE -> 8
  • CSN -> 7

Properties:
byte cePin
CE Pin controls RX / TX, default 8.
byte csnPin
CSN Pin (Chip select not), default 7.
byte channel
RF Channel 0 - 127 or 0 - 84 in the US, default 0.
byte payload
Size in bytes, default 16, max 32.

NB: channel and payload must be the same for all nodes.

Methods:
void init(void)
Initialize the module, set the pin modes for the configurable pins and initialize the SPI module.
Example:
Mirf.csnPin = 9;
Mirf.cePin = 7;

Mirf.spi = &MirfHardwareSpi; // Set the SPI driver

Mirf.init();

void setRADDR(byte *addr)
Set the receiving address. Addresses are 5 bytes long.
Example:
Mirf.setRADDR((byte *)"addr1"); 

void setTADDR(byte *addr)
Set the sending address.
Example:
Mirf.setTADDR((byte *)"addr1");

void config(void)
Set channel and payload width. Power up in RX mode and flush RX fifo.
Example:
Mirf.payload = 32;
Mirf.channel = 2;
Mirf.config();

bool dataReady(void)
Is there data ready to be received?.
Example:
if(Mirf.dataReady()){
  //Get the data to play with.
}

void getData(byte *data)
Get the received data. 'data' should be an array of bytes Mirf.payload long.
Example:
byte data[Mirf.payload]
Mirf.getData(data);

void send(byte *data)
Send data. 'data' should be Mirf.payload bytes long.

bool isSending(void)
Return true if still trying to send. If the chip is still in transmit mode then this method will return the chip to receive mode.
Example:
Mirf.send(data);

while(Mirf.isSending()){
 //Wait.
}

//Chip is now in receive mode.

NB: Lots more information is available from the status registers regarding acknolagement or failure status. See Mirf.cpp:218.

bool rxFifoEmpty(void)
Is the RX Fifo Empty.
bool txFifoEmpty(void)
Is the TX Fifo Empty.

byte getStatus(void)
Return the status register.

void powerUpRx(void)
Power up chip and set to receive mode. Also clear sending interrupts.
void powerUpTx(void)
Power up tx mode.

Examples

See examples folder in zip file.

Other documentation

Also see this extensive nRF24L01 How-To on the ArduinoInfo.Info WIKI HERE

Share