replaced pinChange interrupt with timer interrupt