实验结果:
00节点向01发送:00ReqMesFor01
01节点向00发送:CodeNewNiceBoy
并且在串口打印出相应信息
硬件电路:

01 软件
00节点代码:
- /*00 */
-
- #include
- #include
- #include
- RF24 radio(9, 10);// CE, CSN
-
- const char text[32] = {0}; //用于存放接收到的数据
-
- const byte addresses[][6] = {"66666", "88888"};//为双向通信创建两个通道地址,6为写通道,8为读取通道
-
- void setup() {
- Serial.begin(9600);
- radio.begin();
- radio.setChannel(114); // 设置信道(0-127),114号通道
- radio.openWritingPipe(addresses[0]); // 88888
- radio.openReadingPipe(1, addresses[1]); // 66666
- radio.setPALevel(RF24_PA_HIGH);
- }
- void loop() {
- radio.stopListening();
- const char text2[] =