diff --git a/lib/denko/sensor/hcsr04.rb b/lib/denko/sensor/hcsr04.rb index 56a5cd4..82c7558 100644 --- a/lib/denko/sensor/hcsr04.rb +++ b/lib/denko/sensor/hcsr04.rb @@ -15,6 +15,9 @@ def initialize_pins(options={}) def after_initialize(options={}) super(options) + # Avoid generating extraneous alerts when used with Denko::PiBoard. + echo.stop + # Receive values from echo pin. echo.add_callback { |data| self.update(data) } end