Pyserial使用
来源:互联网 发布:linux nginx 支持php 编辑:程序博客网 时间:2024/05/16 08:57
Environment : WIN-7 64BitPython Ver : V3.3.2
Pyserial Ver : V2.7
1. import the lib
import serial2. List the available ports
import serialfor i in range(50):try:ser = serial.Serial(i)print("COM"+str(i+1))ser.close()except serial.SerialException:pass
3. Send a byte
ser.write(0xAA)4. Send a string
Greet = bytearray("Hello World", 'ascii')ser.write(Greet)5. Send a byte array
command = [0xAA, 0x04, 0x12, 0x44]ser.write(command)6. Get the received data count
dataLen = ser.inWaiting()7. Read the received data
ser.read(dataLen)
- Pyserial使用
- pySerial使用初步
- Python使用pyserial进行串口通信
- python串口通讯模块pySerial使用随笔
- 不同python版本在使用pyserial的一些使用区别
- Raspberry pi 使用python+pySerial实现串口通信
- 【Python入门】 使用 pip 安装 pySerial 串口通讯模块
- Python使用模块Pyserial模块报<ImportError:No module named tools.list_ports>
- 分享自己使用python+pyserial+pyQT5写的串口调试助手
- python pyserial 串口
- python install pyserial
- Python串口模块pySerial
- Python串口模块pySerial
- Anaconda安装Pyserial
- Windows安装pyserial
- python安装pyserial
- Python3.2----串口模块Pyserial
- python中pyserial模块使用方法
- uninstall PC Tools Registry Mechanic with WindowsUninstaller.Org Removal Tips
- 使用Intel HAXM为Android模拟器加速,媲美真机
- ubuntu 使用gnome shell后回复窗口最小化功能
- AudioUnit Input Samples
- Android下常见的内存泄露 经典
- Pyserial使用
- 详解MySQL中EXPLAIN解释命令
- SqlDataAdapter适配器的用法(ADO.NET无连接模式访问数据库)
- 认识BufferedReader的readLine、ready,以及InputStream的available
- sql server中如何查看执行效率不高的语句
- 常用网址
- VS工程配置输出debug版dll及copy到指定目录,执行bat脚本的方法
- windows下加入删除服务
- Kernel monitor and performance tools