在Arduino IDE中启动串行监视器时,是否有一种方法可以防止复位?
Arduino Playground网站对防止Arduino重新启动的不同方法进行了详细的分解,附有一些背景和解释。
http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection
如果您要连接Windows PC,可以使用这个简单的PowerShell脚本(在Arduino Mega上测试过):
$port = new-Object System.IO.Ports.SerialPort COM8,9600,None,8,one
$port.DtrEnable = $false
$port.open()
while ($true) {
$nChar = $port.BytesToRead
if ($nChar -gt 0) {Write-Host -NoNewline $port.ReadExisting()}
}