python 树莓派串口中断_树莓派RaspberryPi串口Python操作指南

本文档介绍了如何使用Python的`serial`模块在树莓派上进行串口通信,包括打开、配置和关闭串口,设置波特率、数据位、停止位和校验位等。此外,还提供了不同平台下的使用示例,适用于初学者和开发者参考。
摘要由CSDN通过智能技术生成

Overview

This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named "serial" automatically selects the appropriate backend.

It is released under a free software license, see LICENSE.txt

for more details.

(C) 2001-2008 Chris Liechti cliechti@gmx.net

The project page on SourceForge

and here is the SVN repository

and the Download Page

.

The homepage is on http://pyserial.sf.net/

Features

same class based interface on all supported platforms

access to the port settings through Python 2.2+ properties

port numbering starts at zero, no need to know the port name in the user program

port string (device name) can be specified if access through numbering is inappropriate

support for different bytesizes, stopbits, parity and flow control with RTS/CTS and/or Xon/Xoff

working with or without receive timeout

file like API with "read" and "write" ("readline" etc. also supported)

The files in this package are 100% pure Python. They depend on

non standard but common packages on Windows (pywin32) and Jython

(JavaComm). POSIX (Linux, BSD) uses only modules from the standard

Python distribution)

The port is set up for binary transmission. No NULL byte

stripping, CR-LF translation etc. (which are many times enabled for

POSIX.) This makes this module universally useful.

Requirements

Pyth

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值