예제 #1
0
        private void SetScoreLights()
        {
            if (_score >= 1)
            {
                _score1.TurnOn();
            }
            else
            {
                _score1.TurnOff();
            }

            if (_score >= 2)
            {
                _score2.TurnOn();
            }
            else
            {
                _score2.TurnOff();
            }

            if (_score >= 3)
            {
                _score3.TurnOn();
            }
            else
            {
                _score3.TurnOff();
            }
        }
예제 #2
0
    /// <summary>Starts the motor running in the set direction</summary>
    public void Start()
    {
        switch (Direction)
        {
        case Rotation.Clockwise:
            _clockwise.TurnOn();
            _counterclockwise?.TurnOff();
            break;

        case Rotation.Counterclockwise:
            _clockwise.TurnOff();
            _counterclockwise?.TurnOn();
            break;

        default:
            throw new InvalidEnumArgumentException(nameof(Direction));
        }
        _enabled?.TurnOn();
    }
예제 #3
0
 /// <summary>Stops the motor immediately</summary>
 public void Stop()
 {
     _clockwise.TurnOff();
     _counterclockwise?.TurnOff();
     _enabled?.TurnOff();
 }
예제 #4
0
 /// <summary>Clears the value stored in the register</summary>
 public void Clear()
 {
     _clear?.TurnOn();
     _output.Spike();
     _clear?.TurnOff();
 }
예제 #5
0
 public void TurnGreen()
 {
     _red.TurnOff();
     _green.TurnOn();
     _blue.TurnOff();
 }