An open API service indexing awesome lists of open source software.

https://github.com/lemonpi/motorshieldcontroller

Motor controller for Arduino through a motor shield
https://github.com/lemonpi/motorshieldcontroller

Last synced: 4 months ago
JSON representation

Motor controller for Arduino through a motor shield

Awesome Lists containing this project

README

          

## Arduino library for a H-Bridge motor controller (driver) of a single motor

Two ways to use this:
1. Drop directory directly inside sketch

or

1. Move directory under Arudino libraries directory
2. In Arduino IDE with sketch open select Sketch > Include Library > WheelEncoder (should be under Contributed Libraries)

## Usage

Connect pins according to data sheet

```c++
#include
#include

// shield pins
constexpr auto DIR_LEFT = 13;
constexpr auto ENABLE_LEFT = 11;

constexpr auto DIR_RIGHT = 12;
constexpr auto ENABLE_RIGHT = 10;

MotorShieldController mc(DIR_LEFT, DIR_RIGHT, ENABLE_LEFT, ENABLE_RIGHT);

void setup() {
}

void loop() {
mc.setLeftVelocity(50);
mc.setRightVelocity(-50);
mc.go();
}
```