Skip to main content

SDK for CheezPico(PPG) 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cheez_ppg_pico-1.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

cheez_ppg_pico-1.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file cheez_ppg_pico-1.0.1.tar.gz.

File metadata

  • Download URL: cheez_ppg_pico-1.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for cheez_ppg_pico-1.0.1.tar.gz
Algorithm Hash digest
SHA256 863b5c414ecb6d29fddf9168b0f72063bca4f0750ce4e7e04022ef403f249fd4
MD5 133c13a343ad80da3c65093addbb77c2
BLAKE2b-256 812c4ff3b53766a57e130d3110f9a4bd0515226629592aaa153f98d7ed974560

See more details on using hashes here.

File details

Details for the file cheez_ppg_pico-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cheez_ppg_pico-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for cheez_ppg_pico-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47335632e10ac943e308886b2fc4a4cccae5fa0904ac14008ba78404fe4789d9
MD5 21040732cc3baa0c9480a4aff3a42115
BLAKE2b-256 fd1e23ddb1cad0eb18eb7c244a4bf7ebb9c4829b050639f306335758c1d25390

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