esphome-docs/components/output/tlc59208f.rst

121 lines
3.3 KiB
ReStructuredText
Raw Normal View History

2019-10-14 11:38:20 +02:00
TLC59208F
=========
.. seo::
:description: Instructions for setting up TLC59208F LED PWM drivers.
:image: tlc59208f.jpg
:keywords: TLC59208F
.. _tlc59208f-component:
Component
---------
The TLC59208F component represents a Texas Instruments TLC59208F 8-bit PWM driver
(`datasheet <http://www.ti.com/lit/gpn/tlc59208f>`__,
`hw example <https://faboplatform.github.io/ArduinoDocs/03.I2C%20Brick/211_brick_i2c_7seg/>`__) 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 ``tlc59208f`` chip and specify its address and id, and then define the
:ref:`individual output channels <tlc59208f-output>`.
.. code-block:: yaml
# Minimalistic configuration entry, single chip, single output
tlc59208f:
address: 0x10
id: tlc59208f_1
# Individual outputs
output:
- platform: tlc59208f
tlc59208f_id: 'tlc59208f_1'
channel: 0
Configuration variables:
************************
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x20``.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this tlc59208f component. Use this if you have multiple TLC59208Fs connected at the same time
.. _tlc59208f-output:
PWM Output
----------
The TLC59208F output component exposes a TLC59208F PWM channel of a global
:ref:`TLC59208F chip <tlc59208f-component>` as a float
output.
.. figure:: images/tlc59208f-full.jpg
:align: center
:width: 75.0%
Sample application of a TLC59208F 8-Channel PWM Driver.
.. code-block:: yaml
# Complete example configuration entry for 3 drivers and 4 outputs
# Maximum 64 drivers with 8 outputs each
tlc59208f:
- address: 0x20
id: tlc59208f_1
- address: 0x22
id: tlc59208f_2
- address: 0x24
id: tlc59208f_3
# Individual outputs
output:
- platform: tlc59208f
id: 'tlc59208f_1_ch0'
channel: 0
tlc59208f_id: 'tlc59208f_1'
- platform: tlc59208f
id: 'tlc59208f_1_ch4'
channel: 4
tlc59208f_id: 'tlc59208f_1'
- platform: tlc59208f
id: 'tlc59208f_2_ch2'
channel: 2
tlc59208f_id: 'tlc59208f_2'
- platform: tlc59208f
id: 'tlc59208f_3_ch7'
channel: 7
tlc59208f_id: 'tlc59208f_3'
# Sample use as a RGB light
light:
- platform: rgb
name: "Sample RGB light"
red: tlc59208f_1_ch0
green: tlc59208f_1_ch4
blue: tlc59208f_2_ch7
Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Choose the channel of the TLC59208F for
this output component. Must be in range from 0 to 7.
- **tlc59208f_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:ref:`TLC59208F chip <tlc59208f-component>`.
Use this if you have multiple TLC59208Fs 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/light/rgb`
- :doc:`/components/fan/speed`
- :doc:`/components/power_supply`
- :apiref:`tlc59208f/tlc59208f_output.h`
- :ghedit:`Edit`