Skip to content

# Class evam::TB6612FNGDriver

template <int kPinSpeed, int kPinMode1, int kPinMode2>

ClassList > evam > TB6612FNGDriver

Driver for the TB6612FNG dual H-bridge motor driver. More...

- `#include <evamTB6612Driver.h>`

## Public Functions

Type | Name
--- | ---
int | GetMode1Pin () const Get the first direction pin number.
int | GetMode2Pin () const Get the second direction pin number.
int | GetSpeedPin () const Get the speed PWM pin number.
| TB6612FNGDriver () Constructor. Initializes pins and stops the motor.

## Protected Functions

Type | Name
--- | ---
void | actBipolar (signed short aValue) Set bipolar (signed) control value.

## Detailed Description

Pin connection: * PWMA - speed control PWM pin * AIN1 / AIN2 - direction control pins for motor A * PWMB, BIN1, BIN2 for motor B (use separate instance)

Template parameters:

- `kPinSpeed` PWM pin for speed control
- `kPinMode1` Direction pin 1 (IN1)
- `kPinMode2` Direction pin 2 (IN2)

## Public Functions Documentation

### function GetMode1Pin

Get the first direction pin number.

    inline int evam::TB6612FNGDriver::GetMode1Pin () const

Returns:

Direction pin 1 (IN1) number.

### function GetMode2Pin

Get the second direction pin number.

    inline int evam::TB6612FNGDriver::GetMode2Pin () const

Returns:

Direction pin 2 (IN2) number.

### function GetSpeedPin

Get the speed PWM pin number.

    inline int evam::TB6612FNGDriver::GetSpeedPin () const

Returns:

Speed control PWM pin number.

### function TB6612FNGDriver

Constructor. Initializes pins and stops the motor.

    inline evam::TB6612FNGDriver::TB6612FNGDriver ()

## Protected Functions Documentation

### function actBipolar

Set bipolar (signed) control value.

    inline void evam::TB6612FNGDriver::actBipolar (
        signed short aValue
    )

Parameters:

- `aValue` Range -1000..1000. Positive = forward, negative = reverse, 0 = stop.

The documentation for this class was generated from the following file `src/evamTB6612Driver.h`