Skip to content

szolotykh/pykinisi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pykinisi

Python package for kinisi motor controller. This package is used to control the kinisi motor controller via serial interface.
Description of the commands can be found in Kinisi Motion Controller framework documentation

Installation

Install pykinisi with pip:

pip install pykinisi

Controlling Single Motor

This example shows how to connect to the motor controller and control a single motor.\

import time
from pykinisi import *

port = "COM3"

controller = KinisiController()
if not controller.connect(port):
    print(f"Can't open serial connection. Port: {port}")
    exit()

# Motor test
motor_index = MotorIndex.Motor0
speed = 40 # Speed in percentage

# Is motor reversed 
is_reversed = False
 
controller.initialize_motor(motor_index, is_reversed)

# Set motor speed to speed
controller.set_motor_speed(motor_index, speed)
time.sleep(5)

# Stop motor
controller.stop_motor(motor_index)

More Examples

There are several examples in the examples folder which show how to use the pykinisi package to control the kinisi motor controller.
Run the examples with:

cd examples
python <example_file> <serial_port>

Package Development

Install pykinisi for development:

pip install -e .

Update KinisiCommands.py file:

cd tools
pip install -r requirements.txt
python update-commands.py --branch=main

Links

About

python package for kinisi motor controller

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages