Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ It has simple controlls to move the device around, while also displaying a live

The lightweight Python API handles all serial communication and provides convenient command execution and debug message printing.
The interface includes functions to home, move, and calibrate the device, as well as to query device information.
Simply copy the [open_micro_stage_api.py](software/PythonAPI/open_micro_stage_api.py) file into your project (also install the dependencies in requirements.txt), and you’re ready to get started.

This library has not been published to pypi yet but it can be installed by running the following pip command. This can also be added to your projects requirements.txt:

```bash
pip3 install "git+https://github.com/0x23/MicroManipulatorStepper/#subdirectory=software/PythonAPI"
```

If you would like to use the calibration plotter then you will need the additional `plotter` optional dependency.

## Usage Example
```python
Expand Down
135 changes: 135 additions & 0 deletions software/PythonAPI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.ruff_cache/

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db
21 changes: 21 additions & 0 deletions software/PythonAPI/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python projects require the license to be local to the folder. THis is a straight copy of the original license


Copyright (c) 2025 Github User '0x23' (https://github.com/0x23/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software, hardware design, documentation, or concept (the "Work"), to deal in the Work
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Work, and to permit persons
to whom the Work is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Work, including but not limited to products or
derivative works based on the presented concepts, designs, or arrangements, even if
the original design files are not directly used.

THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WORK
OR THE USE OR OTHER DEALINGS IN THE WORK.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# create interface and connect
oms = OpenMicroStageInterface(show_communication=True, show_log_messages=True)
oms.connect('/dev/ttyACM0')
oms.connect("/dev/ttyACM0")

# run this once to calibrate joints
# for i in range(3): oms.calibrate_joint(i, save_result=True)
Expand All @@ -15,4 +15,4 @@
oms.wait_for_stop()

# print some info
oms.read_device_state_info()
oms.read_device_state_info()
5 changes: 5 additions & 0 deletions software/PythonAPI/open_micro_stage_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Open Micro Stage - Python API for micro-manipulator control."""

from .api import OpenMicroStageInterface

__all__ = ["OpenMicroStageInterface"]
5 changes: 5 additions & 0 deletions software/PythonAPI/open_micro_stage_api/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Main file for open micro stage"""

from open_micro_stage.calibration_plotter import main

main()
Loading