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; } }
public void Write(GpioValues value) { File.WriteAllText(Path.Combine(_gpioPath, "value"), ((int)value).ToString()); Directory.SetLastWriteTime(Path.Combine(_gpioPath), DateTime.UtcNow); }