Debouncing binary sensory

neat solution. however a simpler approach is outlined here