TESTED WORKING CODE. light up and encoder failed so using timer instead