Metadata-Version: 2.4
Name: harp.syringepump
Version: 0.1.0a1
Summary: This is a generated Harp device Python interface that interacts with the Harp protocol.
Project-URL: Repository, https://github.com/fchampalimaud/harp.devices/
Project-URL: Bug Tracker, https://github.com/fchampalimaud/harp.devices/issues
Project-URL: Documentation, https://fchampalimaud.github.io/pyharp/harp.syringepump/
Author-email: "Hardware and Software Platform, Champalimaud Foundation" <software@research.fchampalimaud.org>
License-File: LICENSE
Keywords: harp,python
Requires-Python: <4.0,>=3.9
Requires-Dist: harp-protocol==0.2.0
Description-Content-Type: text/markdown

# harp.syringepump

[![PyPI](https://img.shields.io/pypi/v/harp.syringepump)](https://pypi.org/project/harp.syringepump/)

This is a generated Harp device Python interface that interacts with the Harp protocol.

- **Github repository**: <https://github.com/fchampalimaud/harp.devices/>
- **Bug Tracker**: <https://github.com/fchampalimaud/harp.devices/issues>
- **Documentation**: <https://fchampalimaud.github.io/pyharp/harp.syringepump/>

# Installation
You can install the package using `uv` or `pip`:

```bash
uv add harp.syringepump
```
or

```bash
pip install harp.syringepump
```

# Usage example

```python
from harp.protocol import OperationMode
from harp.devices.syringepump import SyringePump

# Example usage of the SyringePump device
with SyringePump("/dev/ttyUSB0") as device: # For Windows, use "COM8" or similar
    device.info()

    # Set the device to active mode
    device.set_mode(OperationMode.ACTIVE)

    # Get the events
    try:
        while True:
            for event in device.get_events():
                # Do what you need with the event
                print(event.payload)
    except KeyboardInterrupt:
        # Capture Ctrl+C to exit gracefully
        print("Exiting...")
    finally:
        # Do what you need to do to clean up. Disconnect is automatically called with the "with" statement.
        pass
```