Implementing Auto Advance Switch

Not working from cold start.
Is sensing switch.