#include "SPI.h"
#include "NRFLite.h"
NRFLite _radio;
uint8_t _data;
void setup()
{
Serial.begin(115200);
_radio.init(0, 9, 10); // Set radio to Id = 0, along with its CE (9) and CSN (10) pins
}
void loop()
{
while (_radio.hasData())
{
_radio.readData(&_data);
Serial.println(_data);
}
}#include "SPI.h"
#include "NRFLite.h"
NRFLite _radio;
uint8_t _data;
void setup()
{
_radio.init(1, 9, 10); // Set radio to Id = 1, along with the CE (9) and CSN (10) pins
}
void loop()
{
_data++;
_radio.send(0, &_data, sizeof(_data)); // Send data to the radio with Id = 0
delay(1000);
}- Very small number of public methods to learn, see NRFLite.h for their descriptions.
- No long radio addresses, no need to enable features like retries, auto-acknowledgment packets, dynamic packet sizes, or setting the transmit power (max is enabled by default).
- 2-pin operation on AVR microcontrollers (ATtiny/ATmega) inspired by NerdRalph's article.
- 4-pin operation using shared CE and CSN pins.
- Operation with or without interrupts using the radio's IRQ pin.
- Installation via the Arduino library manager (just search for
nrflite). - Compatibility with the RF24 library.
- The GPIO pins you select on the microcontroller should not share any additional components, eg. a Digispark contains an LED on PB1 and USB connections on PB3 and PB4, so do not use those pins.
- The R2 resistor does not need to be exactly 5K, anything between 4K and 6K is good. I often use two 10K resistors in parallel to create 5K.
- This mode is significantly slower than other hookup options so only use it when speed is not needed.
Radio MISO -> Arduino 12 MISO
Radio MOSI -> Arduino 11 MOSI
Radio SCK -> Arduino 13 SCK
Radio CE -> Any GPIO Pin (can be same as CSN)
Radio CSN -> Any GPIO Pin (pin 10 recommended)
Radio IRQ -> Any GPIO Pin (optional)
Arduino Pin 10 is the SPI Slave Select (SS) pin and must stay as an OUTPUT.
Radio MISO -> Physical Pin 7
Radio MOSI -> Physical Pin 8
Radio SCK -> Physical Pin 9
Radio CE -> Any GPIO Pin (can be same as CSN)
Radio CSN -> Any GPIO Pin
Radio IRQ -> Any GPIO Pin (optional)
Arduino pin names (pictured in brown) using the MIT High-Low Tech library https://github.com/damellis/attiny.
Radio MISO -> Physical Pin 5
Radio MOSI -> Physical Pin 6
Radio SCK -> Physical Pin 7
Radio CE -> Any GPIO Pin (can be same as CSN)
Radio CSN -> Any GPIO Pin
Radio IRQ -> Any GPIO Pin (optional)
Arduino pin names (pictured in brown) using the MIT High-Low Tech library https://github.com/damellis/attiny.






