23 void setup()
override;
35 static float us_to_m(uint32_t us);
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
This class simplifies creating components that periodically check a state.
Base-class for all sensors.
float get_setup_priority() const override
void set_echo_pin(InternalGPIOPin *echo_pin)
void dump_config() override
uint32_t pulse_time_us_
2 meters.
InternalGPIOPin * echo_pin_
ISRInternalGPIOPin echo_isr_
static float us_to_m(uint32_t us)
Helper function to convert the specified echo duration in µs to meters.
void set_timeout_us(uint32_t timeout_us)
Set the timeout for waiting for the echo in µs.
GPIOPin * trigger_pin_
Helper function to convert the specified distance in meters to the echo duration in µs.
void set_pulse_time_us(uint32_t pulse_time_us)
Set the time in µs the trigger pin should be enabled for in µs, defaults to 10µs (for HC-SR04)
void set_trigger_pin(GPIOPin *trigger_pin)
void setup() override
Set up pins and register interval.
Providing packet encoding functions for exchanging data with a remote host.