https://github.com/shahriyardx/l298n
A library to control motors using the L298N Dual motor driver
https://github.com/shahriyardx/l298n
Last synced: 2 months ago
JSON representation
A library to control motors using the L298N Dual motor driver
- Host: GitHub
- URL: https://github.com/shahriyardx/l298n
- Owner: shahriyardx
- Created: 2023-07-26T20:22:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T20:24:01.000Z (almost 2 years ago)
- Last Synced: 2025-02-15T04:44:05.344Z (4 months ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# L298N Driver
This is a library to control motors using the L298N Dual motor driver.
This driver can be used to control 2 DC motor's speed and direction.This library can be used to control 2 motors direction and speed individually.
# Examples
```c++
// attach motor
driver.motor_one.attach(5, 6, 7); // ENA, in1, in2
driver.motor_two.attach(8, 9, 10); // ENB, in3, in4// Rotate clockwise
driver.motor_one.forward();
driver.motor_two.forward();// Rotate counter-clockwise
driver.motor_one.backward();
driver.motor_two.backward();// Setting speed
driver.motor_one.set_speed(100); // 0 to 255
driver.motor_two.set_speed(100); // 0 to 255// Brake
driver.motor_one.brake();
driver.motor_two.brake();```