esphome-docs/api/output/esp8266-pwm.rst

38 lines
856 B
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
ESP8266 Software PWM
====================
Software PWM for the ESP8266. Warning: This is a *software* PWM and therefore can have noticeable flickering.
Additionally, this software PWM can't output values higher than 80%. That's a known limitation.
2018-06-01 18:10:00 +02:00
.. _esp8266_pwm-example_usage:
2018-05-13 11:37:02 +02:00
Example Usage
-------------
.. code-block:: cpp
// Basic
auto *output = App.make_esp8266_pwm_output(D2);
// Create a brightness-only light with it:
App.make_monochromatic_light("Desk Lamp", output);
// Advanced: Setting a custom frequency globally
analogWriteFreq(500);
2018-05-14 21:15:49 +02:00
.. cpp:namespace:: nullptr
2018-05-13 11:37:02 +02:00
See :cpp:func:`Application::make_esp8266_pwm_output`.
API Reference
-------------
.. cpp:namespace:: nullptr
ESP8266PWMOutput
****************
.. doxygenclass:: output::ESP8266PWMOutput
:members:
:protected-members:
:undoc-members: