没有合适的资源?快使用搜索试试~ 我知道了~
Python Document 经典资料
需积分: 50 24 下载量 194 浏览量
2018-09-05
19:26:01
上传
评论 1
收藏 296KB PDF 举报
温馨提示
试读
61页
Python Document 经典资料 Python Document 经典资料
资源推荐
资源详情
资源评论
python-ev3dev Documentation
Release 2.0.0beta1.post3
Ralph Hempel et al
Aug 31, 2018
Contents
1 Getting Started 3
2 Usage 5
2.1 The template for a Python script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Important: Make your script executable (non-Visual Studio Code only) . . . . . . . . . . . . . . . . 6
2.3 Controlling the LEDs with a touch sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Running a single motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Driving with two motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.6 Using text-to-speech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 User Resources 9
4 Upgrading this Library 11
5 Developer Resources 13
6 Python 2.x and Python 3.x Compatibility 15
6.1 Upgrading from ev3dev-jessie (library v1) to ev3dev-stretch (library v2) . . . . . . . . . . . . . . . . 15
6.1.1 Updating import statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.1.2 Remove references to connected attribute . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.1.3 Screen class has been renamed to Display . . . . . . . . . . . . . . . . . . . . . . . . 16
6.1.4 Reorganization of RemoteControl, BeaconSeeker and InfraredSensor . . . . . 16
6.1.5 Re-designed Sound class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.2 Once you’ve adapted to breaking changes, check out the cool new features! . . . . . . . . . . . . . . 16
6.3 API reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.3.1 Motor classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.3.2 Sensor classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.3.3 Other classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.4 Working with ev3dev remotely using RPyC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.5 Frequently-Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.5.1 My script works when launched as python3 script.py but exits immediately or throws
an error when launched from Brickman or as ./script.py . . . . . . . . . . . . . . . . 51
i
ii
python-ev3dev Documentation, Release 2.0.0beta1.post3
A Python3 library implementing an interface for ev3dev devices, letting you control motors, sensors, hardware but-
tons, LCD displays and more from Python code.
If you haven’t written code in Python before, you’ll need to learn the language before you can use this library.
Contents 1
剩余60页未读,继续阅读
资源评论
ys1203
- 粉丝: 1
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功