I am writing a program that waits for button 1 to be pressed. once it is pressed for 5 second it will call the LED ON api and when button 1 is pressed again for single shot then LED will goes off.
But issue is that when i am press button for 5 second it will call the LED OFF api but LED off API,called when button 1 is pressed for single shot.
Is this possible? if yes then please suggest an answer..