Crates.io | l298n |
lib.rs | l298n |
version | 0.2.0 |
source | src |
created_at | 2019-10-15 20:46:15.93804 |
updated_at | 2021-05-20 20:01:59.562478 |
description | A rust driver for the L298N (Dual H-Bridge Motor Controller module) |
homepage | |
repository | https://github.com/lucazulian/l298n |
max_upload_size | |
id | 172804 |
size | 11,509 |
l298n
no_std driver for L298N (Dual H-Bridge Motor Controller module)
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();