Remarks

Tb67h420ftg
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Motors.Tb67h420ftg

Code Example

Tb67h420ftg motorDriver;

PushButton button1;
PushButton button2;

public override Task Initialize()
{
    Console.WriteLine("Initialize...");

    button1 = new PushButton(Device, Device.Pins.D12, ResistorMode.InternalPullDown);
    button2 =  new PushButton(Device, Device.Pins.D13, ResistorMode.InternalPullDown);

    button1.PressStarted += Button1_PressStarted;
    button1.PressEnded += Button1_PressEnded;
    button2.PressStarted += Button2_PressStarted;
    button2.PressEnded += Button2_PressEnded;

    motorDriver = new Tb67h420ftg(Device,
        inA1: Device.Pins.D04, inA2: Device.Pins.D03, pwmA: Device.Pins.D01,
        inB1: Device.Pins.D05, inB2: Device.Pins.D06, pwmB: Device.Pins.D00,
        fault1: Device.Pins.D02, fault2: Device.Pins.D07,
        hbMode: Device.Pins.D09, tblkab: Device.Pins.D10);

    // 6V motors with a 12V input. this clamps them to 6V
    motorDriver.Motor1.MotorCalibrationMultiplier = 0.5f;
    motorDriver.Motor2.MotorCalibrationMultiplier = 0.5f;

    Console.WriteLine("Initialization complete.");

    return base.Initialize();
}

private void Button1_PressStarted(object sender, EventArgs e)
{
    Console.WriteLine("Motor 1 start.");
    motorDriver.Motor1.Power = 1f;
}
private void Button1_PressEnded(object sender, EventArgs e)
{
    Console.WriteLine("Motor 1 stop.");
    motorDriver.Motor1.Power = 0f;
}

private void Button2_PressStarted(object sender, EventArgs e)
{
    Console.WriteLine("Motor 2 start.");
    motorDriver.Motor2.Power = 0.5f;
}
private void Button2_PressEnded(object sender, EventArgs e)
{
    Console.WriteLine("Motor 2 stop.");
    motorDriver.Motor2.Power = 0f;
}

Sample project(s) available on GitHub

Wiring Example

To wire a Tb67h420ftg to your Meadow board, connect the following:

Tb67h420ftg Meadow Pin
GND GND
VCC 5V
INA1 D04
INA2 D03
PWMA D01
INB1 D05
INB2 D06
PWMB D00
LOW1 D02
LOW2 D07
HBMODE D09
TBLKAB D10

It should look like the following diagram:

Characteristic Locus
Inheritance System.Object > Tb67h420ftg
Namespace Meadow.Foundation.Motors
Assembly Tb67h420ftg.dll

Syntax

public class Tb67h420ftg : object

Constructors

Tb67h420ftg(IMeadowDevice, IPin, IPin, IPin, Nullable<IPin>, Nullable<IPin>, Nullable<IPin>, Nullable<IPin>, Nullable<IPin>, Nullable<IPin>, Nullable<IPin>)

Declaration
public Tb67h420ftg(IMeadowDevice device, IPin inA1, IPin inA2, IPin pwmA, IPin? inB1, IPin? inB2, IPin? pwmB, IPin? fault1, IPin? fault2, IPin? hbMode = null, IPin? tblkab = null)

Parameters

Type Name Description
IMeadowDevice device
IPin inA1
IPin inA2
IPin pwmA
System.Nullable<IPin> inB1
System.Nullable<IPin> inB2
System.Nullable<IPin> pwmB
System.Nullable<IPin> fault1
System.Nullable<IPin> fault2
System.Nullable<IPin> hbMode
System.Nullable<IPin> tblkab

Tb67h420ftg(IPwmPort, IPwmPort, IDigitalOutputPort, Nullable<IPwmPort>, Nullable<IPwmPort>, Nullable<IDigitalOutputPort>, Nullable<IDigitalInputPort>, Nullable<IDigitalInputPort>, Nullable<IDigitalOutputPort>, Nullable<IDigitalOutputPort>)

Declaration
public Tb67h420ftg(IPwmPort inA1, IPwmPort inA2, IDigitalOutputPort pwmA, IPwmPort? inB1, IPwmPort? inB2, IDigitalOutputPort? pwmB, IDigitalInputPort? fault1, IDigitalInputPort? fault2, IDigitalOutputPort? hbMode = null, IDigitalOutputPort? tblkab = null)

Parameters

Type Name Description
IPwmPort inA1
IPwmPort inA2
IDigitalOutputPort pwmA
System.Nullable<IPwmPort> inB1
System.Nullable<IPwmPort> inB2
System.Nullable<IDigitalOutputPort> pwmB
System.Nullable<IDigitalInputPort> fault1
System.Nullable<IDigitalInputPort> fault2
System.Nullable<IDigitalOutputPort> hbMode
System.Nullable<IDigitalOutputPort> tblkab

Fields

fault1

Declaration
protected IDigitalInputPort? fault1

Field Value

Type Description
System.Nullable<IDigitalInputPort>

fault2

Declaration
protected IDigitalInputPort? fault2

Field Value

Type Description
System.Nullable<IDigitalInputPort>

hbMode

Declaration
protected IDigitalOutputPort? hbMode

Field Value

Type Description
System.Nullable<IDigitalOutputPort>

hbridgeMode

Declaration
protected Tb67h420ftg.HBridgeMode hbridgeMode

Field Value

Type Description
Tb67h420ftg.HBridgeMode

inA1

Declaration
protected IPwmPort inA1

Field Value

Type Description
IPwmPort

inA2

Declaration
protected IPwmPort inA2

Field Value

Type Description
IPwmPort

inB1

Declaration
protected IPwmPort? inB1

Field Value

Type Description
System.Nullable<IPwmPort>

inB2

Declaration
protected IPwmPort? inB2

Field Value

Type Description
System.Nullable<IPwmPort>

pwmA

Declaration
protected IDigitalOutputPort pwmA

Field Value

Type Description
IDigitalOutputPort

pwmB

Declaration
protected IDigitalOutputPort? pwmB

Field Value

Type Description
System.Nullable<IDigitalOutputPort>

tblkab

Declaration
protected IDigitalOutputPort? tblkab

Field Value

Type Description
System.Nullable<IDigitalOutputPort>

Properties

Motor1

Declaration
public HBridgeMotor Motor1 { get; protected set; }

Property Value

Type Description
HBridgeMotor

Motor2

Declaration
public HBridgeMotor Motor2 { get; protected set; }

Property Value

Type Description
HBridgeMotor

Methods

ValidateConfiguration()

Declaration
protected void ValidateConfiguration()