public int ReadDistance() { if (mode != IRMode.Proximity) { Mode = IRMode.Proximity; } return brick.BrickPi.Sensor[(int)Port].Value; }