Add rising and falling edge detectors