public LightSensor(Device D) : base(D) { RootToDir = D.RootToDir; if (D._type == DeviceType.lego_ev3_Light) { if (ReadVar("modes") != "COL-REFLECT COL-AMBIENT COL-COLOR REF-RAW RGB-RAW COL-CAL") { throw new InvalidOperationException("this device is not a LightSensor if it is and is failing to detect it then please notify me on git"); } } _Options = new string[] { "Value", "RGB", "REF_RAWValue", "Color", "Mode" }; PORT = new LegoSensor(D); }
public UltraSonic(Device D) : base(D) { RootToDir = D.RootToDir; if (D._type == DeviceType.lego_ev3_UltraSound) { if (ReadVar("modes") != "US-DIST-CM US-DIST-IN US-LISTEN US-SI-CM US-SI-IN US-DC-CM US-DC-IN") { throw new InvalidOperationException("this device is not a touch sensor if please notify me on git"); } } _Options = new string[] { "Value", "Mode" }; PORT = new LegoSensor(D); }
public TouchSensor(Device D) : base(D) { RootToDir = D.RootToDir; if (D._type == DeviceType.lego_ev3_Touch) { if (ReadVar("modes") != "TOUCH") { throw new InvalidOperationException("this device is not a touch sensor if please notify me on git"); } } _Options = new string[] { "IsPressed" }; PORT = new LegoSensor(D); }
public GyroSensor(Device D) : base(D) { RootToDir = D.RootToDir; if (D._type == DeviceType.lego_ev3_Gyro) { if (ReadVar("modes") != "GYRO-ANG GYRO-RATE GYRO-FAS GYRO-G&A GYRO-CAL TILT-RATE TILT-ANG") { throw new InvalidOperationException("this device is not a touch sensor if please notify me on git"); } } _Options = new string[] { "Value", "G_and_AValue", "CALValue", "Mode" }; PORT = new LegoSensor(D); }