public string GyroSensor_modes_To_String(GyroSensor_modes x)
        {
            switch (x)
            {
            case (GyroSensor_modes.GYRO_ANG):
                return("GYRO-ANG");

            case (GyroSensor_modes.GYRO_CAL):
                return("GYRO-CAL");

            case (GyroSensor_modes.GYRO_FAS):
                return("GYRO-FAS");

            case (GyroSensor_modes.GYRO_G_and_A):
                return("GYRO-G&A");

            case (GyroSensor_modes.GYRO_RATE):
                return("GYRO-RATE");

            case (GyroSensor_modes.TILT_ANG):
                return("TILT-ANG");

            case (GyroSensor_modes.TILT_RATE):
                return("TILT-RATE");

            default:
                throw new Exception("this should never happen");
            }
        }
 public void SetModeTo(GyroSensor_modes x)
 {
     WriteVar("mode", GyroSensor_modes_To_String(x));
 }