Crate tb6612fng

Source
Expand description

This is a no_std driver for the TB6612FNG motor driver as can e.g. be found on the corresponding SparkFun module.

The motor driver itself supports two motors and has a standby pin which controls both motors at the same time. The crate can be either used to control a single motor (using the Motor struct directly) or to control both motors (using the Tb6612fng struct) - the latter also supports using the standby functionality.

§When to use what

  • You plan on using both motors and the standby feature: use Tb6612fng
  • You plan on using both motors without the standby feature: use two separate Motors
  • You plan on using a single motor with the standby feature: use Motor and control the standby pin manually
  • You plan on using a single motor without the standby feature: use Motor

Structs§

Motor
Represents a single motor (either motor A or motor B) hooked up to a TB6612FNG controller.
Tb6612fng
Represents a TB6612FNG controller.

Enums§

DriveCommand
Defines the possible drive commands.
MotorError
Defines errors which can happen when calling Motor::drive().
Tb6612fngError
Defines errors which can happen when calling Tb6612fng::new().