Skip to main content

wonderbits by mfeducation.

Project description

python-sdk

主要服务于豌豆拼硬件产品

需要搭配豌豆拼硬件模块使用

Powered by MFEducation

  1. 包含各个模块的api

    • 显示模块
    • 控制模块
    • 彩灯模块
    • 射频通信模块
    • 等等
  2. 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


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.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wonderbits-4.2.1-py2.py3-none-any.whl (15.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wonderbits-4.2.1.tar.gz.

File metadata

  • Download URL: wonderbits-4.2.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for wonderbits-4.2.1.tar.gz
Algorithm Hash digest
SHA256 a39dc2a590c5e36457c4af068d2cc4dd5b68a0c040dd0c7d6d985528c6a524c7
MD5 e16ef51f65a817adb3bd83e14959f169
BLAKE2b-256 4418eb924dc34e3fa03b80fe3c746bc69711672fc8ed3528a1fb62d8140d3f69

See more details on using hashes here.

File details

Details for the file wonderbits-4.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: wonderbits-4.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.7 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/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for wonderbits-4.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7037a6373cf0544f017f6824cc0cc884c49084e8b0fc1ea24c773d5f07d072bd
MD5 59e064dd030bf499fff5512b0dd7a5bf
BLAKE2b-256 4d1fe7ab3e3cbf726c7359fb1f2cd98ced80ae5bd67bbf1f87313c2a570ebb0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page