Пример #1
0
        public void Pulse(GpioValues value, int milliseconds)
        {
            switch (value)
            {
            case GpioValues.Low:
                Write(GpioValues.Low);
                System.Threading.Thread.Sleep(milliseconds);
                Write(GpioValues.High);
                break;

            case GpioValues.High:
                Write(GpioValues.High);
                System.Threading.Thread.Sleep(milliseconds);
                Write(GpioValues.Low);
                break;
            }
        }
Пример #2
0
 public void Write(GpioValues value)
 {
     File.WriteAllText(Path.Combine(_gpioPath, "value"), ((int)value).ToString());
     Directory.SetLastWriteTime(Path.Combine(_gpioPath), DateTime.UtcNow);
 }