[英]Command for opening serial port in Windows 7
是否有用於打開串行端口的 Windows 命令,例如通過 Windows 7 中的命令提示符說 COM3? 例如:
OPEN "COM6" AS #1
我無法使用 pyserial 或任何其他未隨 Windows 7 分發的實用程序。
也許你可以使用Powershell? 它包含在Win7中...
寫入串行端口
PS> [System.IO.Ports.SerialPort]::getportnames()
COM3
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine("Hello world")
PS> $port.Close()
從串行端口讀取
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
將文件內容發送到串行端口:
copy file.bin com1 /b
將幾個字符發送到串行端口:
echo hello > com1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.