|
@@ -14,12 +14,43 @@
|
|
|
#include "printf.h"
|
|
#include "printf.h"
|
|
|
#include "RF24.h"
|
|
#include "RF24.h"
|
|
|
|
|
|
|
|
-#define RF24_ce_pin 10
|
|
|
|
|
-#define RF24_csn_pin 11
|
|
|
|
|
|
|
+//0x35 duze
|
|
|
|
|
+//#define RF24_ce_pin 8 //53 //8 //7
|
|
|
|
|
+//#define RF24_csn_pin 9 //48 //9//10
|
|
|
|
|
+
|
|
|
|
|
+//0x36 male
|
|
|
|
|
+//#define RF24_ce_pin 7 //8 //7
|
|
|
|
|
+//#define RF24_csn_pin 10 //9//10
|
|
|
|
|
+
|
|
|
|
|
+//0x41 pilot
|
|
|
|
|
+
|
|
|
|
|
+//#define RF24_ce_pin 8 //53 //8 //7
|
|
|
|
|
+//#define RF24_csn_pin 9 //48 //9//10
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//auto
|
|
|
|
|
+#define RF24_ce_pin 34 //8 //53 //8 //7
|
|
|
|
|
+#define RF24_csn_pin 36 // 9 //48 //9//10
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
|
|
+ * See documentation at https://nRF24.github.io/RF24
|
|
|
|
|
+ * See License information at root directory of this library
|
|
|
|
|
+ * Author: Brendan Doherty (2bndy5)
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * A simple example of sending data from 1 nRF24L01 transceiver to another.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This example was written to be used on 2 devices acting as "nodes".
|
|
|
|
|
+ * Use the Serial Monitor to change each node's behavior.
|
|
|
|
|
+ */
|
|
|
|
|
+#include <SPI.h>
|
|
|
|
|
+#include "printf.h"
|
|
|
|
|
+#include "RF24.h"
|
|
|
|
|
|
|
|
// instantiate an object for the nRF24L01 transceiver
|
|
// instantiate an object for the nRF24L01 transceiver
|
|
|
-//RF24 radio(RF24_ce_pin, RF24_csn_pin); // using pin 7 for the CE pin, and pin 8 for the CSN pin
|
|
|
|
|
-RF24 radio(10, 11); // using pin 7 for the CE pin, and pin 8 for the CSN pin
|
|
|
|
|
|
|
+RF24 radio( RF24_ce_pin, RF24_csn_pin); // using pin 7 for the CE pin, and pin 8 for the CSN pin
|
|
|
|
|
|
|
|
// Let these addresses be used for the pair
|
|
// Let these addresses be used for the pair
|
|
|
uint8_t address[][6] = {"1Node", "2Node"};
|
|
uint8_t address[][6] = {"1Node", "2Node"};
|
|
@@ -31,7 +62,7 @@ uint8_t address[][6] = {"1Node", "2Node"};
|
|
|
bool radioNumber = 1; // 0 uses address[0] to transmit, 1 uses address[1] to transmit
|
|
bool radioNumber = 1; // 0 uses address[0] to transmit, 1 uses address[1] to transmit
|
|
|
|
|
|
|
|
// Used to control whether this node is sending or receiving
|
|
// Used to control whether this node is sending or receiving
|
|
|
-bool role = true ;//false; // true = TX role, false = RX role
|
|
|
|
|
|
|
+bool role = false; // true = TX role, false = RX role
|
|
|
|
|
|
|
|
// For this example, we'll be using a payload containing
|
|
// For this example, we'll be using a payload containing
|
|
|
// a single float number that will be incremented
|
|
// a single float number that will be incremented
|
|
@@ -155,4 +186,4 @@ void loop() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-} // loop
|
|
|
|
|
|
|
+} // loop
|