Ejemplo n.º 1
0
        public bool IsOn(Enums.Led led)
        {
            switch (led)
            {
            case Enums.Led.Heartbeat:
                return(_heartbeat.State);

            default:
                throw new ArgumentOutOfRangeException(nameof(led), led, null);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 6
0
        public Led(Enums.Led led)
        {
            _gpioPin = Pi.Gpio[(int)led];

            Initialize();
        }