Added count based debouncing to sensors

Yet to be compiled or tested