Controlling servo direction using one push button

Hi, @sudhir98
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

It will show you how to post your code in a scrolling window.
In the IDE press CTRL T, it will ident your code to make it easier to see your if statement scope.

What model Arduino are you using?

Thanks.. Tom... :smiley: :+1: :coffee: :australia: