10 namespace ultrasonic {
23 void setup()
override;
35 static float us_to_m(uint32_t us);
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) ...
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
uint32_t pulse_time_us_
2 meters.
GPIOPin * trigger_pin_
Helper function to convert the specified distance in meters to the echo duration in µs...
void dump_config() override
void set_timeout_us(uint32_t timeout_us)
Set the timeout for waiting for the echo in µs.
This class simplifies creating components that periodically check a state.
void set_trigger_pin(GPIOPin *trigger_pin)
InternalGPIOPin * echo_pin_
void set_echo_pin(InternalGPIOPin *echo_pin)
static float us_to_m(uint32_t us)
Helper function to convert the specified echo duration in µs to meters.
void setup() override
Set up pins and register interval.
ISRInternalGPIOPin echo_isr_
Implementation of SPI Controller mode.
Base-class for all sensors.
float get_setup_priority() const override