How do you disable a Timer ?
When you set it to null, it keeps firing. And at some strange interval !
private Timer _Off_Timer;
public LCD_Backlight()
{
_GPIO_LED = GpioController.GetDefault().OpenPin(Hardware.LCD_BackLight_Pin);
_GPIO_LED.SetDriveMode(GpioPinDriveMode.Output);
_GPIO_LED.Write(GpioPinValue.Low);
}
public void On()
{
_GPIO_LED.Write(GpioPinValue.High);
_Off_Timer = new Timer(Timer_Elapsed, null,
TimeSpan.FromSeconds(5),
TimeSpan.FromSeconds(5));
}
private void Timer_Elapsed(object state)
{
_GPIO_LED.Write(GpioPinValue.Low);
_Off_Timer = null;
}