SDK for CheezPico USB/BLE Devices
Project description
Cheez SDK
Installation
pip install cheez_semg_pico
Quick Start
from cheez_semg_pico import CheezPico
import asyncio
async def main():
sEMG = CheezPico()
device = None
try:
print("Connecting to device...")
device = sEMG.connect() # 连接设备
print("Configuring device...")
await sEMG.set_device_id(1) # 设置设备ID:0~255
await sEMG.set_sampling_rate("250 Hz") # 配置采样率:100Hz,250Hz,500Hz (note the space)
await sEMG.set_wear_detection(enable=False) # 设置是否开启佩戴检测
await sEMG.set_filter_state(enable=True) # 设置是否开启滤波
print("Reading data (press Ctrl+C to exit)...")
while True:
data = await device.read_data() # 读取设备
print(data)
await asyncio.sleep(0.01) #小延迟,防止CPU过载
except ValueError as e:
print(f"Configuration error: {e}")
except asyncio.TimeoutError:
print("Device communication timeout")
except KeyboardInterrupt:
print("\nUser interrupted. Exiting...")
except Exception as e:
print(f"Unexpected error: {type(e).__name__}: {e}")
finally:
if device is not None:
print("Disconnecting device...")
sEMG.disconnect()
print("Device disconnected")
if __name__ == "__main__":
asyncio.run(main())
Features
- Easy device port discovery
- Simple serial connection management
- Async data reading
- Configurable logging
- Error handling and validation
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
cheez_semg_pico-1.1.4.tar.gz
(7.7 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 cheez_semg_pico-1.1.4.tar.gz.
File metadata
- Download URL: cheez_semg_pico-1.1.4.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7535e6034da8229249a772ec01210cecfb676a8a50162d9b053aeada00b117e
|
|
| MD5 |
4e9bdd556df016020057dacf3396ef15
|
|
| BLAKE2b-256 |
8d20a85653da3e88d204f7edd650eec30a57a4a12b6671afbcceacdbcfbbdded
|
File details
Details for the file cheez_semg_pico-1.1.4-py3-none-any.whl.
File metadata
- Download URL: cheez_semg_pico-1.1.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80383a2abce7803da7aa1efa141fe0df2de588ee458c17434c3c80e6a3fd7370
|
|
| MD5 |
d889cd3cdf1e855f8501d1fd8818cc44
|
|
| BLAKE2b-256 |
ed29c204386fab6993f5d9d2ad2fbe87f5b7a637d553405b6b3b91dbf878c0b5
|