wonderbits by mfeducation.
Project description
python-sdk
主要服务于豌豆拼硬件产品
需要搭配豌豆拼硬件模块使用
Powered by MFEducation
-
包含各个模块的api
- 显示模块
- 控制模块
- 彩灯模块
- 射频通信模块
- 等等
-
sdk中包含串口通信功能
- 插上硬件模块可以直接通信
简单示例
创建一个py文件 demo.py
# 导入需要的模块
from wonderbits import Display, Led, Control
import random
import time
# 创建必要的模块对象
display1 = Display()
led = Led()
control1 = Control()
# 豌豆拼硬件复位等待时间,后期会优化
time.sleep(8)
# 定义一个全局变量
content = 1
while True:
# 在显示模块上第一行第一列显示变量content
display1.print(1, 1, content)
content = content + 1
# 设置彩灯模块颜色, 颜色随机
led.set_rgb(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
# 获取控制模块sw4开关状态值
sw4 = control1.get_sw4()
print('我收到sw4状态{}'.format(sw4))
# 获取开关sw3的位置
isAtOne = control1.is_sw3_at_1()
print('我收到sw在1位置{}'.format(isAtOne))
运行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-4.2.3.tar.gz
(13.0 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-4.2.3.tar.gz.
File metadata
- Download URL: wonderbits-4.2.3.tar.gz
- Upload date:
- Size: 13.0 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 |
6014ad2de412cf672773ff048d7e46fa260bebada1fd0f041a70ba9c176c4c72
|
|
| MD5 |
740c93d01c9cfb8a5094e65fb662a370
|
|
| BLAKE2b-256 |
91d524ab71a819b026b7f96612c1d92b64de713121bfeedbd8419f2a0c84d318
|
File details
Details for the file wonderbits-4.2.3-py2.py3-none-any.whl.
File metadata
- Download URL: wonderbits-4.2.3-py2.py3-none-any.whl
- Upload date:
- Size: 17.0 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 |
db3d739f805a879ce63a30e832a7e5d04925ab25893fe9b2e12a5a2d86cc3681
|
|
| MD5 |
a135da052d8f18515881fe156bed4d67
|
|
| BLAKE2b-256 |
ddc2515b95dcda93584e76ac145a26bef088afc8247b3b7bea516aae08e9549e
|