最近在做一个小项目, 现在出现的问题是code在usb+外接电源连接的状态下arduino整个都是运行很正常。 但是当我拔掉USB只使用电源分别试了几个9v 和12v 1-2a的电源 arduino都是无法工作(不断的on and off)。这个项目使用了vin直接来给一个外接设备供电, 同时arduino读取它的digital数据,然后两个电路share了同一个ground。 阅读了一些资料是建议我把TX和RX用10k电阻链接,“The basic problem is the Arduino seeing a floating input to the RX line on the serial port. While booting up the Arduino bootloader searches for an update from a host computer, and if it finds one it loads it up and runs it. But with the RX line floating it sees garbage data and sits there indefinitely waiting for an update that will never come.
The solution is easy when you know how. Just stick a 10k resistor across the RX and TX connections (ie: digital pins 0 and 1) or from RX to GND when you're not using the USB connection and the Arduino will boot cleanly and execute your code as expected.”
以上是找到的资料的原文。
这个并没有解决我的问题,但是 同时我也发现当我这样设置之后 当我的手摸在arduino 表面 或者线路金属部分时 arduino可以正常工作了,很无语。。。。。应该是一个线路问题, 不知道有没有大神遇到过类似问题,有没有什么解决方案, 或者我如何用其他物件来模拟一个人手摸在金属上的情况来让我的项目working。