Skip to content

A Rust library to control the Tic series of stepper motor controllers created by Pololu.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

unl-rocketry/pololu_tic-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pololu Tic Rust Driver

Lib.rs Version docs.rs GitHub Actions Workflow Status

A Rust crate for controlling the Pololu Tic series of stepper motor drivers. It supports the same devices the official Arduino driver does, namely the T500, T834, T825, T249, and 36v4, along with the USB control mode that the pololu-tic-software program supports.

This driver by default will work in no-std enviroments like microcontrollers, but is perfectly suitable for using on other computers with the usb feature enabled.

Currently, this driver supports the I²C, Serial, and USB control modes which the Tic devices support. This driver only supports embedded-hal >= 1.0.

Important

The Tic devices utilize I²C clock-stretching, which can cause timeouts and errors on some chips. Ensure you increase the I²C timeout delay on your chip if you are getting timeout errors while using this library.

Warning

USB support is untested, experimental and the interface may change at any time.

Feature Flags

This library has a few feature flags to enable or disable support for different interfaces.

  • i2c (default): Enables support for the I²C interface.
  • serial: Enables support for the UART Serial interface.
  • usb: Enables the USB interface support using nusb, and implies the std feature.
  • std: Enables std support, which enables traits and conversions in a few libraries.

License

This library is licensed under the MIT and Apache 2.0 permissive open-source licenses. Please review the terms of these licenses to decide how to incorporate this library into your projects.

Example

A basic example of using this library to set up and control a Tic36v4 is as follows. Ensure you replace <i2c_bus> with your platform's embedded_hal I²C interface.

use pololu_tic::{TicBase, TicI2C, TicProduct};

let mut tic = pololu_tic::TicI2C::new_with_address(
    <i2c_bus>,
    TicProduct::Tic36v4,
    14
);

tic.set_target_velocity(2000000);

loop {
    tic.reset_command_timeout();
}

About

A Rust library to control the Tic series of stepper motor controllers created by Pololu.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages