Python 官方文档:入门教程 => 点击学习
import serial import time t = serial.Serial('com6', 115200) #USB COM number on your PC and the transfer bit rate of th
import serial
import time
t = serial.Serial('com6', 115200) #USB COM number on your PC and the transfer bit rate of the COM port.
print t.portstr #Display the working UART port number on your PC.
n = t.write('loGCat -c \r')
n = t.write('ampclient_samples 2 -O 3 /mnt/media_rw/B278-E25A/video_Google_clips/New_WEBm/bunny_1080P.webm \r')
time.sleep(3)
print "Does the stream output nORMally? Yes=1 or No=2"
Input = int(raw_input())
if Input == 1:
print "Pass!!!"
n = t.write(chr(0x03)) #Call for Ctrl+C command in UART port
n = t.write('logcat -c \r')
else:
print "Fail!!!"
n = t.write(chr(0x03))
#n = t.write('logcat -v threadtime /r')
--结束END--
本文标题: Python中COM口的调用
本文链接: https://www.lsjlt.com/news/191565.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0