esphome-docs/api/sensor/ultrasonic.rst
2018-05-14 21:15:49 +02:00

32 lines
703 B
ReStructuredText

Ultrasonic Sensor
=================
Example Usage
-------------
.. code-block:: cpp
// Basic
App.make_ultrasonic("Ultrasonic", 12, 13); // trigger pin: 12, echo pin: 13
// Filter out timeouts
auto ultrasonic = App.make_ultrasonic("Ultrasonic", 12, 13);
ultrasonic.mqtt->set_filters({
new sensor::FilterOutNANFilter(), // filter out timeouts
});
// Set timeout, 4 meters
ultrasonic.sensor->set_timeout_m(4.0f);
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_ultrasonic_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::UltrasonicSensorComponent
:members:
:protected-members:
:undoc-members: