Auto refresh added

resetFunc() provides reset mechanism. We’ll have to change the delay
time according to the length of the final code in order to get
appropriate frequency