public bool IsOn(Enums.Led led) { switch (led) { case Enums.Led.Heartbeat: return(_heartbeat.State); default: throw new ArgumentOutOfRangeException(nameof(led), led, null); } }
public void Toggle(Enums.Led led) { switch (led) { case Enums.Led.Heartbeat: _heartbeat.State = !_heartbeat.State; break; default: throw new ArgumentOutOfRangeException(nameof(led), led, null); } }
public void On(Enums.Led led) { switch (led) { case Enums.Led.Heartbeat: _heartbeat = true; break; default: throw new ArgumentOutOfRangeException(nameof(led), led, null); } Log.Information($"Led On: {led}"); }
public bool IsOn(Enums.Led led) { const string logInfo = "Led {0} State: {1}"; switch (led) { case Enums.Led.Heartbeat: Log.Information(string.Format(logInfo, led, _heartbeat)); return(_heartbeat); default: throw new ArgumentOutOfRangeException(nameof(led), led, null); } }
public void Toggle(Enums.Led led) { const string logInfo = "Led {0} Toggle, State: {1}"; switch (led) { case Enums.Led.Heartbeat: _heartbeat = !_heartbeat; Log.Information(string.Format(logInfo, led, _heartbeat)); break; default: throw new ArgumentOutOfRangeException(nameof(led), led, null); } }
public Led(Enums.Led led) { _gpioPin = Pi.Gpio[(int)led]; Initialize(); }