wonderbits by mfeducation.
Project description
python-sdk
主要服务于豌豆拼硬件产品
需要搭配豌豆拼硬件模块使用
Powered by MFEducation
-
包含各个模块的api
- 显示模块
- 控制模块
- 彩灯模块
- 射频通信模块
- 等等
-
sdk中包含串口通信功能
- 插上硬件模块可以直接通信
简单示例
创建一个py文件 demo.py
# 导入需要的模块
from wonderbits import Display, Control, Led
import time
import random
# 初始化模块
d1 = Display()
c1 = Control()
l1 = Led()
# 隐藏控制台输出 (默认方式为关闭, 任一个豌豆拼模块的实例调用 hide_console() 方法)
# c1.hide_console()
# 开启控制台输出 (任一个豌豆拼模块的实例,如c1.show_console())
d1.show_console()
# 显示模块显示内容
d1.print(2, 1, 'value:')
# 计数变量
content = 1
for i in range(10):
# 获取控制模块开关sw4的值
sw4 = c1.get_sw4()
# 在显示屏上显示sw4的值
d1.print(2, 7, sw4)
# 设置彩灯rgb随机颜色
l1.set_rgb(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
# 显示模块显示计数值
d1.print(1, 1, content)
# 将计数变量 递增1
content += 1
运行py文件
运行环境:需要python -V 为3版本
运行:
python demo.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wonderbits-5.0.0.tar.gz
(13.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wonderbits-5.0.0.tar.gz.
File metadata
- Download URL: wonderbits-5.0.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45440b12399adba0dabae7706f93e20c7bb431ec5e02760be24ad7fca58bf671
|
|
| MD5 |
e62250d6807f865759a874bc9584456f
|
|
| BLAKE2b-256 |
a14010679c007b9f5bfd566ea3014a98b855ca3f3b61ff81345eba5109a5ac78
|
File details
Details for the file wonderbits-5.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: wonderbits-5.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c57143938a3cc535c47245da3379b4110ddbee57be187f4cad559c929a8cf7c5
|
|
| MD5 |
7cce485add563ccd5dde7dc07c4fe0e6
|
|
| BLAKE2b-256 |
8b23f60da35fd8fa366fad9b3032b5ace9b8b3c0f960aa82b4b6268057602a57
|