Skip to main content

easy_mi_cybergear

使用python通过USB-CAN模块轻松控制小米cybergear微电机

pip install easy_mi_cybergear
from easy_mi_cybergear import Cybergear
import time
motor = Cybergear(baud_rate=921600, port="COM10")

# 电机使能运行 (通信类型 3) 电机会嗡嗡的响
motor.set_motor_enable(motor_can_id=127)

# 电机停止运行 (通信类型 4)
motor.set_motor_stop(motor_can_id=127)

# 设置电机机械零位(通信类型 6)会把当前电机位置设为机械零位(掉电丢失)
motor.set_motor_zero_position(motor_can_id=127)

# 位置模式,使电机转到2rad的位置,速度限制为1rad/s
motor.set_motor_move_by_position(position=2, speed_limt=10,motor_can_id=127)

time.sleep(1)

# 速度模式,设置电机速度为1rad/s,电流限制为23A(默认值)
motor.set_motor_move_by_speed(speed=1, motor_can_id=127)

time.sleep(2)

# 电机停止运行 (通信类型 4)
motor.set_motor_stop(motor_can_id=127)

TODO

  • 错误判断
  • 读取当前数据

Metadata

Release files for easy-mi-cybergear 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy-mi-cybergear 1.0.5
File Size Uploaded Provenance Actions
easy_mi_cybergear-1.0.5.tar.gz 4.6 kB Without provenance Details for easy_mi_cybergear-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easy-mi-cybergear 1.0.5
File Interpreter ABI Platform Actions
easy_mi_cybergear-1.0.5-py3-none-any.whl Python 3 none any Details for easy_mi_cybergear-1.0.5-py3-none-any.whl

Total release size: 11.1 kB

Release files / easy_mi_cybergear-1.0.5.tar.gz

Download URL easy_mi_cybergear-1.0.5.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5fc60f0504493afa08d3618750aea6ff9b5e37b4c987bbe542c70c281ad5b7c1
BLAKE2b-256 checksum
How to use checksums
e20039d9737ea1192958b9a6264352f6ffcfb562e8fc68a5c749083e5e0bcf58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / easy_mi_cybergear-1.0.5-py3-none-any.whl

Download URL easy_mi_cybergear-1.0.5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e7b7a351dbaa4ef475b53f0e7990544a0eef439d847c51d3d77602e88d0da80
BLAKE2b-256 checksum
How to use checksums
1def4c3aeb8b68ff43755a7f08b5314ec6575a36bbac487e18f3d1199eb73a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for easy-mi-cybergear 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page