跳转到内容

MCP4725 输出

MCP4725 输出组件允许使用 12 位外部 DAC ,通过 I2C 在任何开发板上获得模拟输出。设备的默认地址为 0x60 ,可配置的备用地址为 0x61。

# Example configuration entry
# Set a global i2c connection
i2c:
sda: 21
scl: 22
scan: true
# Set the output with default (address: 0x60 / global i2c)
output:
- platform: mcp4725
id: dac_output
on_...:
then:
- output.set_level:
id: dac_output
level: 100%
  • id (必需, ID): 用于此输出组件的 id。

  • address (可选, int): 手动指定 DAC 的 I2C 地址。 默认为 0x60。

  • 所有其他选项请参见 输出。

为了驱动高于 3.3v 电压的模拟模块,请使用 TTL 双向电平转换器

请注意你使用的转换器,其中一些通道标记为 RX 和 TX, 在这种情况下只有 TX 通道是双向的(因此你必须使用 2 个 TX 通道才能让 I2C 工作)。