Skip to content
README.md 1.25 KiB
Newer Older
Gallacchi Mattia's avatar
Gallacchi Mattia committed
# MS210 python driver

This repository contains a small python module to control the MS210 Channel Mixer by Advanced Illumination

Gallacchi Mattia's avatar
Gallacchi Mattia committed
> **NOTE**:
> 
> For linux user add your user to the *dialout* group to access the serial port
>
> ```bash
> sudo usermod -aG dialout $USER
> ```

Gallacchi Mattia's avatar
Gallacchi Mattia committed
## Dependencies

| Name | Version |
|------|---------|
| Python | >= 3.10 |
| Poetry | >= 1.2.0 |

Gallacchi Mattia's avatar
Gallacchi Mattia committed
Install python dependencies:

```bash
poetry install
```

## App

A QT based graphical interface to control the **MS210** is available and can be run with the following command:

```bash
poetry run controller
```

![UI](img/ms210_ui.png)

## Add the MS210 package

Instructions to add the MS210 package to your project
Gallacchi Mattia's avatar
Gallacchi Mattia committed

Gallacchi Mattia's avatar
Gallacchi Mattia committed
### Poetry
Gallacchi Mattia's avatar
Gallacchi Mattia committed

Gallacchi Mattia's avatar
Gallacchi Mattia committed
Add a secondary source to your poetry project
Gallacchi Mattia's avatar
Gallacchi Mattia committed

```bash
Gallacchi Mattia's avatar
Gallacchi Mattia committed
poetry source add -s igib https://labinfo.ing.he-arc.ch/gitlab/api/v4/projects/2417/packages/pypi/simple
```

Add **ms210** package

```bash
poetry add ms210 --source igib
```

### PIP

```bash
pip install pyrsvp --index-url https://labinfo.ing.he-arc.ch/gitlab/api/v4/projects/2417/packages/pypi/simple/
```

## Usage

```python
dev = MS210("/dev/ttyUSB0")

# Set the red value
success, msg = dev.set_value("R", 500)
if not success:
    print(msg)

# Get the green value
green = dev.get_value("G")
print(green)
Gallacchi Mattia's avatar
Gallacchi Mattia committed
```