Hi,
i am trying to port my code to nrflite and having a hard time.
need to send 3 variables and receive them on the other side
current code for transmitting:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int Inputpin[3]; // Used to store value before being sent through the NRF24L01
RF24 radio(2, 3); // NRF24L01 used pins 2 and 3 on the ATTINY84
const uint64_t pipe = 0xE8E8F0F0E1LL; // Needs to be the same for communicating between 2 NRF24L01
void setup()
{
pinMode(7, INPUT); // Define the arcade switch NANO pin as an Input using Internal Pullups
pinMode(8, INPUT);
pinMode(9, INPUT);
//***************************************************
radio.begin(); // Start the NRF24L01
radio.setPALevel(RF24_PA_HIGH);
radio.setDataRate(RF24_1MBPS);
radio.setCRCLength(RF24_CRC_16);
radio.openWritingPipe(pipe); // Get NRF24L01 ready to transmit
}
void loop()
{
Inputpin[0] = digitalRead(7);
Inputpin[1] = digitalRead(8);
Inputpin[2] = digitalRead(9);
//Serial.println(Inputpin[2]);
radio.write( Inputpin, sizeof(Inputpin) );
}
i need to modify it to this format example to match the above code that works very well as is:
#include <SPI.h>
#include <NRFLite.h>
NRFLite _radio;
uint8_t _data;
void setup()
{
Serial.begin(115200);
_radio.init(1, 9, 10); // Set this radio's Id = 1, along with its CE and CSN pins
}
void loop()
{
while (_radio.hasData())
{
_radio.readData(&_data);
Serial.println(_data);
}
}
cant seem to make sense of it.