| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Transmitter/Receiver Example

This example shows the basic steps that are needed to transmit and receive packets using Enhanced ShockBurst (ESB). It consists of two applications, one Transmitter and one Receiver, that use the Enhanced ShockBurst library. After programming each application on an nRF5 development board, you can test that packets that are sent by the board that runs the Transmitter application are picked up by the board that runs the Receiver application. Successful communication is indicated by LED changes, which should be in sync on both boards.

# Transmitter

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\proprietary_rf\esb_ptx`

Compile and program the Transmitter application on a board. This application requires the Receiver application as counterpart, so program that application on a second board.

The Transmitter example sends a packet, waits for a configurable time (50 milliseconds by default), and then sends another packet. In each packet, the 4 least significant bits of the first byte of the payload are incremented (or reset to 0 when they reach 16). The state of the LEDs reflects the 4 least significant bits of the first payload byte of the last packet that was sent and acknowledged. Therefore, if packets are successfully received and acknowledged by the Receiver, the LED pattern will change every 50 milliseconds (with the default delay).

# Receiver

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\proprietary_rf\esb_prx`

Compile and program the Receiver application on a board. This application requires the Transmitter application as counterpart, so program that application on a second board.

The Receiver example listens for packets and sends an ACK when a packet is received. The content of the 4 least significant bits of the first payload byte of the received packet is output on the LEDs. Therefore, if packets are successfully received from the Transmitter, the LED pattern will change every time a packet is received.