public bool valEnabledOutputUsb; // USBリアルタイム出力機能有無 /** * コンストラクタ */ public Hot2gDevInfo() { valDevType = Hot2gEnumerations.EnumHot2gDevType.HOT2000; valDevId = ""; valDevName = ""; valDevFirmVersion = ""; valLotId = ""; valVmaxPd = 4096; valRangeAcc = Hot2gEnumerations.EnumHot2gAccRange.e16G; valRangeGyro = Hot2gEnumerations.EnumHot2gGyroRange.e2000DPS; valSmplRateBatt = Hot2gEnumerations.EnumHot2gBattSmplRate.e1HZ; valSmplRateMot = Hot2gEnumerations.EnumHot2gMotSmplRate.e10HZ; valTransRateBatt = Hot2gEnumerations.EnumHot2gBattTransRate.e1HZ; valTransRateMot = Hot2gEnumerations.EnumHot2gMotTransRate.e10HZ; valTransRateHR = Hot2gEnumerations.EnumHot2gHRTransRate.e1HZ; valResolutePd = 0.805664f; // 12bit, 0~3.3V valResoluteAcc = 0.000488289f; // 16bit, ±16G valResoluteGyro = 0.061036088f; // 16bit, ±2000DPS valEnabledOutputUsb = false; }
/** * モーション加速度換算 * 対象:LSM6DSL * @param raw_data :16bit * @param range :[EnumHot2gAccRange] * @return :[G] */ public static double calcMotionAcc(int raw_data, Hot2gEnumerations.EnumHot2gAccRange range) { double calc = 0.0f; double rate; switch (range) { case Hot2gEnumerations.EnumHot2gAccRange.e2G: rate = 0.000061036f; break; case Hot2gEnumerations.EnumHot2gAccRange.e4G: rate = 0.000122072f; break; case Hot2gEnumerations.EnumHot2gAccRange.e8G: rate = 0.000244144f; break; case Hot2gEnumerations.EnumHot2gAccRange.e16G: rate = 0.000488289f; break; default: rate = 1.0f; break; } calc = (double)raw_data * rate; return(calc); }