Removed delayms and tune the sampling cycle for button