You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
927 B

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define WHICH_NODE 2
RF24 radio(8, 9);
const uint64_t wAddress[] = {0x7878787878LL, 0xB3B4B5B6F1LL}; //, 0xB3B4B5B6CDLL, 0xB3B4B5B6A3LL, 0xB3B4B5B60FLL, 0xB3B4B5B605LL};
const uint64_t PTXpipe = wAddress[ WHICH_NODE - 1 ];
byte counter = 1;
bool done = false;
void setup(){
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_LOW);
radio.setChannel(108);
radio.openReadingPipe(0,PTXpipe);
radio.stopListening();
}
void loop(){
if(!done){
byte randNumber = 222;
int16_t data[] = {7,8,9,10,11,12};
radio.openWritingPipe(PTXpipe);
if(!radio.write( &data, sizeof(data) )){
Serial.println("Guess delivery failed");
}else{
for(int i=0; i<sizeof(data); i++){
Serial.print(data[i]);
Serial.print("\t");
}
Serial.println();
}
}
delay(200);
}