esphome-docs/api/sensor/ultrasonic.rst

32 lines
703 B
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
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);
2018-05-14 21:15:49 +02:00
.. cpp:namespace:: nullptr
2018-05-13 11:37:02 +02:00
See :cpp:func:`Application::make_ultrasonic_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::UltrasonicSensorComponent
:members:
:protected-members:
:undoc-members: