From 083d7ddd339e39ea92bb1b26e3577d5fb49edc1f Mon Sep 17 00:00:00 2001 From: Oskar Napieraj Date: Sun, 24 May 2020 05:06:37 +0200 Subject: [PATCH] ESP32 DAC output documentation (#617) * Add documentation for ESP32 DAC output * Fix SEO * Update images/dac.svg Co-authored-by: Guillermo Ruffino Co-authored-by: Guillermo Ruffino --- components/output/esp32_dac.rst | 46 +++++++++++++++++++++++++++++++++ images/dac.svg | 1 + index.rst | 1 + 3 files changed, 48 insertions(+) create mode 100644 components/output/esp32_dac.rst create mode 100644 images/dac.svg diff --git a/components/output/esp32_dac.rst b/components/output/esp32_dac.rst new file mode 100644 index 000000000..08fd0bd31 --- /dev/null +++ b/components/output/esp32_dac.rst @@ -0,0 +1,46 @@ +ESP32 DAC +========= + +.. seo:: + :description: Instructions for setting up ESP32 digital-to-analog converter. + :image: dac.svg + +The ESP32 DAC platform allows you to output arbitrary voltages using the 8-bit DAC on the ESP32. Two pins are supported: GPIO25 (Channel 1) and GPIO26 (Channel 2). + +The output level is a percentage of VCC (3.3V). + + +.. code-block:: yaml + + # Example configuration entry + output: + - platform: esp32_dac + pin: GPIO25 + id: dac_output + + # Example usage + on_...: + then: + - output.set_level: + id: dac_output + level: 50% + + +Configuration variables: +------------------------ + +- **pin** (**Required**, :ref:`Pin Schema `): The pin to use DAC on. Only GPIO25 and GPIO26 are supported. +- **id** (**Required**, :ref:`config-id`): The id to use for this output component. +- All other options from :ref:`Output `. + +See Also +-------- + +- :doc:`/components/output/index` +- :doc:`/components/output/ledc` +- :doc:`/components/output/esp8266_pwm` +- :doc:`/components/light/monochromatic` +- :doc:`/components/fan/speed` +- :doc:`/components/power_supply` +- :apiref:`esp32_dac/esp32_dac.h` +- :ghedit:`Edit` diff --git a/images/dac.svg b/images/dac.svg new file mode 100644 index 000000000..87cdb32b5 --- /dev/null +++ b/images/dac.svg @@ -0,0 +1 @@ + diff --git a/index.rst b/index.rst index 010f92bb8..58cb6cc39 100644 --- a/index.rst +++ b/index.rst @@ -199,6 +199,7 @@ Output Components ESP8266 Software PWM, components/output/esp8266_pwm, pwm.png Slow PWM, components/output/slow_pwm, pwm.png GPIO Output, components/output/gpio, pin.svg + ESP32 DAC, components/output/esp32_dac, dac.svg ESP32 LEDC, components/output/ledc, pwm.png AC Dimmer, components/output/ac_dimmer, ac_dimmer.svg PCA9685, components/output/pca9685, pca9685.jpg