debounce with seven segment and shift register not lighting correct segments.

ieee488:
Did you write your own debounce routine?
There are tutorials for that.

yes I followed several to get this one. though non of them seem to work when I put them inside a function.