Hi all,
I am using a button will be used to blink an LED. When this button is pressed, I am turning on the LED for 5 seconds, and then turn it off for 5 seconds. The problem is that I want the LED to keep blinking as long as the button is pressed.
How can I achieve this please? I tried using both BUTTON CLICK and BUTTON DOWN but non of them worked (function only executed once). Is there a method that as long as the button is pressed, the program keeps looping in that function?
Note, I am programming using Csharp.
Thanks in advance for your help.
I am using a button will be used to blink an LED. When this button is pressed, I am turning on the LED for 5 seconds, and then turn it off for 5 seconds. The problem is that I want the LED to keep blinking as long as the button is pressed.
How can I achieve this please? I tried using both BUTTON CLICK and BUTTON DOWN but non of them worked (function only executed once). Is there a method that as long as the button is pressed, the program keeps looping in that function?
Note, I am programming using Csharp.
Thanks in advance for your help.