private static void AlarmThread() { alarmOutput = new SoftwarePwm(7, 100, 0.5); // GPIO 7 = CE1 try { while (executionLed.Value) { for (int freq = 100; freq < 1000; freq += 10) { alarmOutput.Frequency = freq; System.Threading.Thread.Sleep(2); } for (int freq = 1000; freq > 100; freq -= 10) { alarmOutput.Frequency = freq; System.Threading.Thread.Sleep(2); } } } catch (ThreadAbortException) { Thread.ResetAbort(); } catch (Exception ex) { Log.Exception(ex); } finally { alarmOutput.Dispose(); } }
public SysfsLinuxGpioPort(IOperatingSystemService operatingSystemService) { this.operatingSystemService = operatingSystemService; softwarePwm = new SoftwarePwm(operatingSystemService, this); }