Metadata-Version: 2.4
Name: servomotor
Version: 0.12.2
Summary: A Python package for controlling M17 Servomotors, the 4-in-1 (motor + dirce + motion control + encoder) integrated servomotors from Gearotons
Author-email: Tom Rodinger <tom@gearotons.com>
License: MIT License
        
        Copyright (c) 2024 Move the Needle Limited (Hong Kong)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software 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 Software.
        
        THE SOFTWARE 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://gearotons.com
Project-URL: Issues, https://tutorial.gearotons.com/feedback
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENCE
Dynamic: license-file


## Usage

Here's a basic example of how to use the servomotor package:

TODO

For more detailed usage instructions, please refer to the documentation.

## Choosing the serial port

The command line tools work out which serial port to use in this order, highest
priority first:

1. `-p PORT` on the command line (`-P` instead pops up a menu of detected ports)
2. the `SERVOMOTOR_PORT` environment variable
3. the port saved from the last successful run
4. an interactive menu, if none of the above apply

So a port can be set once for a whole shell session:

```bash
export SERVOMOTOR_PORT=/dev/ttyUSB0        # Linux
export SERVOMOTOR_PORT=/dev/cu.usbserial-110   # macOS
set SERVOMOTOR_PORT=COM3                   # Windows (cmd)
$env:SERVOMOTOR_PORT = "COM3"              # Windows (PowerShell)
```

`-p` still overrides it for a single command, and `-P` always shows the menu.

After a port is opened successfully it is remembered, in a per-user location:

| Platform | Saved port file |
|----------|-----------------|
| Linux    | `$XDG_CONFIG_HOME/servomotor/serial_device.txt`, else `~/.config/servomotor/serial_device.txt` |
| macOS    | `~/Library/Application Support/servomotor/serial_device.txt` |
| Windows  | `%LOCALAPPDATA%\servomotor\serial_device.txt` |

Delete that file to forget the remembered port.

### Serial port permissions on Linux

Serial devices usually belong to the `dialout` group (`uucp` on some
distributions). If you get a permission error, add yourself to it:

```bash
sudo usermod -a -G dialout $USER
```

then log out and back in for the change to take effect.

## Features

- Control Gearotons servomotors via serial communication
- Easy-to-use interface for sending commands and receiving responses
- Automatic handling of serial port selection and management

## Requirements

- Python 3.6+
- pyserial 3.5+

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contact

Tom Rodinger - tom.rodinger@alumni.utoronto.ca

Project Link: [https://gearotons.com](https://gearotons.com)
