Grove TB6612FNG 电机驱动器
Grove TBB6612FNG 通过 I²C 总线运行,具有控制直流电机和步进电机的能力。 在当前实现阶段,仅实现了直流电机功能。
# 示例配置grove_tb6612fng: - address: 0x14 id: test_motor- id (必需, ID): 此 TB6612FNG 组件使用的 ID。
- address (可选, int): 驱动器的 I²C 地址。
默认为
0x14。
.. grove_tb6612fng.run:
grove_tb6612fng.run 动作
Section titled “grove_tb6612fng.run 动作”通过定义旋转方向和速度来设置电机旋转,速度范围为 0 到 255
on_...: then: - grove_tb6612fng.run: channel: 1 speed: 255 direction: BACKWARD id: test_motor.. grove_tb6612fng.stop:
grove_tb6612fng.stop 动作
Section titled “grove_tb6612fng.stop 动作”设置电机停止运动,但如果有力拉动则不会停止旋转,如果是这种情况,您可能需要使用制动动作
on_...: then: - grove_tb6612fng.stop: channel: 1.. grove_tb6612fng.break:
grove_tb6612fng.break 动作
Section titled “grove_tb6612fng.break 动作”设置电机通道为制动模式,确保轮子即使在受力或推动时也不会旋转
on_...: then: - grove_tb6612fng.break: channel: 1 id: test_motor.. grove_tb6612fng.standby:
grove_tb6612fng.standby 动作
Section titled “grove_tb6612fng.standby 动作”设置电路板在不使用时处于待机模式,可降低功耗并避免静止时的抖动
on_...: then: - grove_tb6612fng.standby id: test_motor.. grove_tb6612fng.no_standby:
grove_tb6612fng.no_standby 动作
Section titled “grove_tb6612fng.no_standby 动作”设置电路板为唤醒状态,每次 ESPHome 重启时,默认模式设置为待机,以确保电机不会意外旋转
on_...: then: - grove_tb6612fng.no_standby id: test_motor.. grove_tb6612fng.change_address:
grove_tb6612fng.change_address 动作
Section titled “grove_tb6612fng.change_address 动作”如果您需要同时连接多个电路板,可以使用此动作更改地址。地址可以更改为 0x01 - 0x7f(包含)范围内的值。
on_...: then: - grove_tb6612fng.change_address: address: 0x15 id: test_motor