Looking in eBay I found the nRF24L01+ in three different modules. I bought the smd module, but for testing is better the module with pin header.
Description of library.
Initializes the nRF24L01 module.
NRF24L01_Init(mode, rf_channel)
- mode: Sets RX_MODE or TX_MODE.
- rf_channel: Sets the channel to be used.
Example:
NRF24L01_Init(TX_MODE, 0x20);
Sends a data from Transmitter to Receiver.
NRF24L01_SendData(buffer)
- buffer: Data to be sent.
Example:
unsigned char data[32] = {'P', 'I', 'C', '1', '8', 'F', '4', '5', '5', '0'};
NRF24L01_SendData(data);
Reads the interrupt.
NRF24L01_DataReady(void)
This function reads the STATUS and returns a 0 logic if the receiver got a new data.
- return 0: When is available a data.
- return 1: When isn't available a data.
Example:
while(NRF24L01_DataReady()){}
Reads a data received from transmitter.
NRF24L01_ReadData(buffer)
- buffer: Saves the data received.
Example:
unsigned char buffer1[32];
while(NRF24L01_DataReady()){}
NRF24L01_ReadData(buffer1);
Sets the nRF24L01 as RX or TX mode.
NRF24L01_SetMode(mode)
NRF24L01_SetMode( RX_MODE);
while(NRF24L01_DataReady()){}
NRF24L01_ReadData(buffer1);
Sets the nRF24L01 as RX or TX mode.
NRF24L01_SetMode(mode)
- mode: Sets RX_MODE or TX_MODE.
NRF24L01_SetMode( RX_MODE);
Sets a channel.
NRF24L01_SetChannel(rf_channel)
NRF24L01_SetChannel(0x45);
Gets the channel used.
NRF24L01_GetChannel(void)
unsigned char channel;
channel = NRF24L01_GetChannel();
Example 1. Simplex communication.
NRF24L01_SetChannel(rf_channel)
- rf_channel: Sets a new channel.
NRF24L01_SetChannel(0x45);
Gets the channel used.
NRF24L01_GetChannel(void)
- return the channel used.
unsigned char channel;
channel = NRF24L01_GetChannel();
Example 1. Simplex communication.
This
video shows a system simplex, where the transmitter sends a byte to
receiver. The receiver gets the byte and set the value binary at the
PORTB.