ESP32 DAC
ESP32 DAC 平台允许你使用 ESP32 的 8 位数模 转换器输出模拟电压。与 Ledc 不同,后者可以通过使用快速 切换频率来模拟模拟信号,硬件 DAC 能够输出 真正的 模拟信号, 无需额外的滤波。
DAC 跨越两个引脚,每个引脚对应各自的通道:
- ESP32: GPIO25(通道 0)和 GPIO26(通道 1)。
- ESP32 S2: GPIO17(通道 0)和 GPIO18(通道 1)。
输出级别是板载供电电压(VDD_A)的百分比 —— 一般为 3.3 V。
# Example configuration entryoutput: - platform: esp32_dac pin: GPIO25 id: dac_output
# Example usageon_...: then: - output.set_level: id: dac_output level: 50%
# Use the DAC output as a lightlight: - platform: monochromatic output: dac_output gamma_correct: 1.4 id: mono_light- pin (必需, Pin Schema): 使用 DAC 的引脚。有效引脚编号请参见上文。
- id (必需, ID): 用于此输出组件的 id。
- 所有其他选项请参见 输出。