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.
33 lines
493 B
33 lines
493 B
|
|
#include <SPI.h>
|
|
#include <nRF24L01.h>
|
|
#include <RF24.h>
|
|
|
|
RF24 radio(8, 9); // CE, CSN
|
|
|
|
const byte address[6] = "00002";
|
|
|
|
void setup() {
|
|
radio.begin();
|
|
radio.openWritingPipe(address);
|
|
radio.setPALevel(RF24_250KBPS);
|
|
radio.stopListening();
|
|
|
|
Serial.begin(9600);
|
|
|
|
}
|
|
|
|
void loop() {
|
|
|
|
|
|
int16_t dataR[] = {1,2,3,4,5,6};
|
|
|
|
for(int i=0; i<6; i++){
|
|
Serial.print(dataR[i]);
|
|
Serial.print("\t");
|
|
}
|
|
Serial.println();
|
|
|
|
radio.write(&dataR, sizeof(dataR));
|
|
delay(100);
|
|
}
|