#stepper-motor #motor #stepper #embedded-hal-driver

no-std pololu_tic

An embedded-hal driver to control the Tic series of stepper motor controllers created by Pololu. "

1 unstable release

new 0.1.0 Feb 21, 2025

#376 in Embedded development

MIT/Apache

48KB
613 lines

Pololu Tic

A Rust embedded-hal library 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.

Currently, this driver only supports I²C, and not the Serial control mode which the Tic devices support. Serial control is planned for the future. This driver also only supports embedded-hal >= 1.0.

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

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();
}

Dependencies

~0.4–0.9MB
~19K SLoC