#hal #io

no-std l298n

A rust driver for the L298N (Dual H-Bridge Motor Controller module)

5 releases

0.2.0 May 20, 2021
0.1.3 Nov 9, 2019
0.1.2 Oct 29, 2019
0.1.1 Oct 17, 2019
0.1.0 Oct 15, 2019

#1509 in Embedded development

23 downloads per month

MIT license

7KB
117 lines

l298n

no_std driver for L298N (Dual H-Bridge Motor Controller module)

Build Status crates.io Docs Coverage Status

Basic usage

Include this library as a dependency in your Cargo.toml:

[dependencies.l298n]
version = "<version>"

Use embedded-hal implementation to get PINA, PINB and PWM and then create a single motor:

extern crate l298n;

let motor = l298n::Motor::new(PINA, PINB, PWM);

motor.set_duty(12);

motor.brake();

or a l298 dual bridge motor:

extern crate l298n;

let motor = l298n::L298N::new(PIN1A, PIN2A, PWM1B, IN2B, PIN1B, PWMB);

motor.a.set_duty(12);

motor.a.brake();

License

MIT license

Dependencies

~71KB