esphome-docs/components/output/pca9685.rst
FrengerH e16c324b1f Component reshuffle (#183)
* Merge remote receiver component with platform

* Merged remote transmitter component with platform

* Merge pca9685 component with output

* Minor fixes

* Minor fix

* Fixed headers

* reshuffled esp32 touch binary sensor

* Reshuffled pn532 rfid reader

* Fixed images

* Reshuffled rdm6300 RFID component

* Reshuffled my9231 led driver component

* Reshuffled ads1115 component

* Reshuffled SSD1306 display component

* Reshuffled Character-Based LCD Display component

* Reshuffled fastled component

* Fixes netlify

* Remove duplicate figure

* Remove duplicate figure

* Remove duplicate figure

* Reorder SSD1306

To my knowledge, the i2c version is more common, so put it first.

* Put fastled clockless above SPI

clockless is more common, so put it first

* Cleanup index

Tag was used initially to distinguish between the component and binary sensor, no longer needed.

* Remove duplicate figure
2019-02-27 10:10:09 +01:00

98 lines
2.7 KiB
ReStructuredText

PCA9685
=======
.. seo::
:description: Instructions for setting up PCA9685 LED PWM drivers.
:image: pca9685.jpg
:keywords: PCA9685
.. _pca9685-component:
Component/Hub
-------------
The PCA9685 component represents a PCA9685 12-bit PWM driver
(`datasheet <https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/ledc.html#configure-channel>`__,
`adafruit <https://www.adafruit.com/product/815>`__) in ESPHome. It
uses :ref:`I²C Bus <i2c>` for communication.
To use the channels of this components, you first need to setup the
global ``pca9685`` hub and give it an id, and then define the
:ref:`individual output channels <pca9685-output>`.
.. code-block:: yaml
# Example configuration entry
pca9685:
frequency: 500
# Individual outputs
output:
- platform: pca9685
pca9685_id: 'pca9685_hub1'
channel: 0
Configuration variables:
************************
- **frequency** (**Required**, float): The frequency to let the
component drive all PWM outputs at. Must be in range from 24Hz to
1526Hz.
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x00``.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this pca9685 component. Use this if you have multiple PCA9685s connected at the same time
.. _pca9685-output:
PWM Output
----------
The PCA9685 output component exposes a PCA9685 PWM channel of a global
:ref:`PCA9685 hub <pca9685-component>` as a float
output.
.. figure:: images/pca9685-full.jpg
:align: center
:width: 75.0%
PCA9685 16-Channel PWM Driver.
.. code-block:: yaml
# Example configuration entry
pca9685:
- frequency: 500
# Individual outputs
output:
- platform: pca9685
id: 'pca9685_output1'
channel: 0
Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the PCA9685 of
this output component. Must be in range from 0 to 15.
- **pca9685_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:ref:`PCA9685 hub <pca9685-component>`.
Use this if you have multiple PCA9685s you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
See Also
--------
- :doc:`/components/output/index`
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/ledc`
- :doc:`/components/light/monochromatic`
- :doc:`/components/fan/speed`
- :doc:`/components/power_supply`
- :apiref:`output/pca9685_output_component.h`
- `PCA9685 Arduino Library <https://github.com/NachtRaveVL/PCA9685-Arduino>`__ by `@NachtRaveVL <https://github.com/NachtRaveVL>`__
- :ghedit:`Edit`
.. disqus::