TB6612FNG.Module (tb6612fng v0.1.0)

Driver for TB6612FNG Module.

Data Sheet

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Sets the standby pin to high, disabling Standby mode.

Sets the standby pin to low. Will stop both motors if they are currently turning, but will retain whatever settings they had set, so if standby mode is disabled, they will start again. Standby mode is a high impedance/low power mode.

Returns the config of the module. Mostly used for troubleshooting/accessing the standby reference directly.

Sets the output of the specified motor in a specific direction.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

disable_standby(name \\ __MODULE__)

Sets the standby pin to high, disabling Standby mode.

Link to this function

enable_standby(name \\ __MODULE__)

Sets the standby pin to low. Will stop both motors if they are currently turning, but will retain whatever settings they had set, so if standby mode is disabled, they will start again. Standby mode is a high impedance/low power mode.

Link to this function

get_config(name)

Returns the config of the module. Mostly used for troubleshooting/accessing the standby reference directly.

Link to this function

set_output(motor, direction, output)

Sets the output of the specified motor in a specific direction.

Accepts three parameters:

  • name - The name (atom) of the GenServer controlling the motor.
  • direction - Either :cw for clockwise or :ccw for counter-clockwise rotation
  • output - The PWM output requested. This should be an integer value between 0 and 1_000_000
Link to this function

start_link(config)