BrickPi.Sensors.EV3IRSensor.Read C# (CSharp) Method

Read() public method

Read the sensor value. The returned value depends on the mode. Distance in proximity mode. Remote command number in remote mode. Beacon location in seek mode.
public Read ( ) : int
return int
        public int Read()
        {
            int value = 0;
            switch (Mode)
            {
                case IRMode.Proximity:
                    value = ReadDistance();
                    break;
                case IRMode.Remote:
                    value = (int)ReadRemoteCommand();
                    break;
                case IRMode.Seek:
                    value = (int)ReadBeaconLocation(); //if using class beacon: .Location
                    break;
            }
            return value;
        }