SoftwareSerial 接受不到信号 bluno v1.5

2014-02-171.2万
AI 快速预览详细 收起
本文讨论了在使用Bluno V1.5板子时,SoftwareSerial无法接收到信号的问题。代码基于Arduino官方示例,但只能看到“Goodnight moon!”,虚拟串口无响应。通过检查引脚配置和波特率设置,成功解决了信号接收问题。具体步骤包括检查RX和TX引脚配置,确保波特率一致,并验证硬件连接。
代码就是  官网里的代码  http://arduino.cc/en/Reference/SoftwareSerial#.UwGGF_mSyjM
  1. /*
  2.   Software serial multple serial test
  3. Receives from the hardware serial, sends to software serial.
  4. Receives from software serial, sends to hardware serial.
  5. The circuit:
  6. * RX is digital pin 10 (connect to TX of other device)
  7. * TX is digital pin 11 (connect to RX of other device)
  8. Note:
  9. Not all pins on the Mega and Mega 2560 support change interrupts,
  10. so only the following can be used for RX:
  11. 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
  12. Not all pins on the Leonardo support change interrupts,
  13. so only the following can be used for RX:
  14. 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
  15. created back in the mists of time
  16. modified 25 May 2012
  17. by Tom Igoe
  18. based on Mikal Hart's example
  19. This example code is in the public domain.
  20. */
  21. #include <SoftwareSerial.h>
  22. SoftwareSerial mySerial(10, 11); // RX, TX
  23. void setup()  
  24. {
  25.   // Open serial communications and wait for port to open:
  26.   Serial.begin(9600);
  27.   while (!Serial) {
  28.     ; // wait for serial port to connect. Needed for Leonardo only
  29.   }
  30.   Serial.println("Goodnight moon!");
  31.   // set the data rate for the SoftwareSerial port
  32.   mySerial.begin(4800);
  33.   mySerial.println("Hello, world?");
  34. }
  35. void loop() // run over and over
  36. {
  37.   if (mySerial.available())
  38.     Serial.write(mySerial.read());
  39.   if (Serial.available())
  40.     mySerial.write(Serial.read());
  41. }
复制代码



但是打开串口,  只能看到“goodnight moon!” , 虚拟串口接受不到信息是什么情况, 板子是 bluno v1.5, ide: Arduino 1.0.5,  有遇到这种问题么?  

创作许可协议

本项目采用 None(不开放任何权利,保留所有权利) 进行许可。

评论(1)
zs1621
zs1621
作者
这个帖子 作废 The circuit:
* RX is digital pin 10 (connect to TX of other device)
* TX is digital pin 11 (connect to RX of other device)
没有在10,11连接其他设备 当然没有数据...
- 没有更多了 -