Arduino nRF2401+ 简单的 1 路传输不起作用

如何解决Arduino nRF2401+ 简单的 1 路传输不起作用

我正在使用 2 个 Arduino nanos 和 2 个 NRF24L01+PA+LNA 模块。我大部分时间都在关注这个 tutorial,并且我已经验证了所有东西都连接到了正确的引脚。我也试过用 2 节 AA 电池直接为 nRF2401 模块供电,因为我听说板载 3.3v 并不总是足够。

发射器:

#include <SPI.h>
#include <RF24.h>
#include "printf.h"

RF24 radio(7,8); // CE,CSN
const uint64_t pAddress = 0xB00B1E5000LL;
#define DHT11_PIN 2

void setup(){
  Serial.begin(9600);
  printf_begin();
  if (!radio.begin()) {
    Serial.println(F("radio hardware is not responding!!"));
    while (1) {} // hold in infinite loop
  }
  radio.setPALevel(RF24_PA_LOW);
  radio.setChannel(25);
  radio.openWritingPipe(pAddress);
  radio.stopListening();
  radio.printDetails();
  radio.printPrettyDetails();
  Serial.print("channel = ");
  Serial.println(radio.getChannel());
}

void loop(){
  const char text[] = "Hello World";
  bool status = radio.write(&text,sizeof(text));
  Serial.print("Transmission Status: ");
  Serial.println(status);

  delay(1000);
 
}

发射机输出

SPI Speedz  = 10 Mhz
STATUS      = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xb00b1e5000 0xc2c2c2c2c2
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR     = 0xb00b1e5000
RX_PW_P0-6  = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA       = 0x3f
EN_RXADDR   = 0x03
RF_CH       = 0x19
RF_SETUP    = 0x03
CONfig      = 0x0e
DYNPD/FEATURE   = 0x00 0x00
Data Rate   = 1 MBPS
Model       = nRF24L01+
CRC Length  = 16 bits
PA Power    = PA_LOW
ARC     = 15
SPI Frequency       = 10 Mhz
Channel         = 25 (~ 2425 MHz)
RF Data Rate        = 1 MBPS
RF Power Amplifier  = PA_LOW
RF Low Noise Amplifier  = Enabled
CRC Length      = 16 bits
Address Length      = 5 bytes
Static Payload Length   = 32 bytes
Auto Retry Delay    = 1500 microseconds
Auto Retry Attempts = 15 maximum
Packets lost on
    current channel = 0
Retry attempts made for
    last transmission   = 15
Multicast       = disabled
Custom ACK Payload  = disabled
Dynamic Payloads    = disabled
Auto AckNowledgment = Enabled
Primary Mode        = TX
TX address      = 0xb00b1e5000
pipe 0 ( open ) bound   = 0xb00b1e5000
pipe 1 ( open ) bound   = 0xc2c2c2c2c2
pipe 2 (closed) bound   = 0xc3
pipe 3 (closed) bound   = 0xc4
pipe 4 (closed) bound   = 0xc5
pipe 5 (closed) bound   = 0xc6
channel = 25
Transmission Status: 0
Transmission Status: 0
Transmission Status: 0
...

接收者

#include <SPI.h>
#include <RF24.h>
#include "printf.h"

RF24 radio(7,CSN
const uint64_t pAddress = 0xB00B1E5000LL;

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.setPALevel(RF24_PA_LOW);
  radio.setChannel(25);
  radio.openReadingPipe(1,pAddress);
  radio.startListening();
  printf_begin();
  radio.printDetails();
  radio.printPrettyDetails();
  Serial.print("channel = ");
  Serial.println(radio.getChannel());
}

void loop() {
    if (radio.available()) {
    char text[32] = "";
    radio.read(&text,sizeof(text));
    Serial.println(text);
  }
}

复活输出

SPI Speedz  = 10 Mhz
STATUS      = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xe7e7e7e7e7 0xb00b1e5000
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR     = 0xe7e7e7e7e7
RX_PW_P0-6  = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA       = 0x3f
EN_RXADDR   = 0x02
RF_CH       = 0x19
RF_SETUP    = 0x03
CONfig      = 0x0f
DYNPD/FEATURE   = 0x00 0x00
Data Rate   = 1 MBPS
Model       = nRF24L01+
CRC Length  = 16 bits
PA Power    = PA_LOW
ARC     = 0
SPI Frequency       = 10 Mhz
Channel         = 25 (~ 2425 MHz)
RF Data Rate        = 1 MBPS
RF Power Amplifier  = PA_LOW
RF Low Noise Amplifier  = Enabled
CRC Length      = 16 bits
Address Length      = 5 bytes
Static Payload Length   = 32 bytes
Auto Retry Delay    = 1500 microseconds
Auto Retry Attempts = 15 maximum
Packets lost on
    current channel = 0
Retry attempts made for
    last transmission   = 0
Multicast       = disabled
Custom ACK Payload  = disabled
Dynamic Payloads    = disabled
Auto AckNowledgment = Enabled
Primary Mode        = RX
TX address      = 0xe7e7e7e7e7
pipe 0 (closed) bound   = 0xe7e7e7e7e7
pipe 1 ( open ) bound   = 0xb00b1e5000
pipe 2 (closed) bound   = 0xc3
pipe 3 (closed) bound   = 0xc4
pipe 4 (closed) bound   = 0xc5
pipe 5 (closed) bound   = 0xc6
channel = 25

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?