Hello,
VS 2008
I have the following code in my timer control
I have 2 buttons start and stop. Start will enable the timer and stop will disable the timer.
The problem was that the PDA would continuely vibrate. So I put it in the timer event and set the interval for 2 seconds. Then in the timer event I sleep for 1 second. This will vibrate it for 1 second then switch it off and do this every 2 seconds.
The problem now is, that the UI will freeze during the pause of 1 second.
Is there a better way to do this?
Many thanks for any advice,
VS 2008
I have the following code in my timer control
Code:
private void tmrVibrate_Tick(object sender, EventArgs e)
{
vibrateAlert = new Led();
vibrateAlert.SetLedStatus(1, Led.LedState.On);
Debug.WriteLine("Vibrating");
Thread.Sleep(1000);
vibrateAlert.SetLedStatus(1, Led.LedState.Off);
}
The problem was that the PDA would continuely vibrate. So I put it in the timer event and set the interval for 2 seconds. Then in the timer event I sleep for 1 second. This will vibrate it for 1 second then switch it off and do this every 2 seconds.
The problem now is, that the UI will freeze during the pause of 1 second.
Is there a better way to do this?
Many thanks for any advice,