@@ -129,7 +129,7 @@ public abstract class ShimmerBluetooth : ShimmerDevice
129129 protected int MagGain ;
130130 protected int LNAccelRange ;
131131 protected int AccelSamplingRate ;
132- protected int Mpu9150SamplingRate ;
132+ protected int GyroSamplingRate ;
133133 protected int AltAccelSamplingRate ;
134134 protected int AltMagSamplingRate ;
135135 protected long ConfigSetupByte0 ; // for Shimmer2
@@ -2239,7 +2239,7 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
22392239 GyroRange = ( int ) ( ( ConfigSetupByte0 >> 16 ) & 0x03 ) ;
22402240 MagGain = ( int ) ( ( ConfigSetupByte0 >> 21 ) & 0x07 ) ;
22412241 AccelSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 4 ) & 0xF ) ;
2242- Mpu9150SamplingRate = ( int ) ( ( ConfigSetupByte0 >> 8 ) & 0xFF ) ;
2242+ GyroSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 8 ) & 0xFF ) ;
22432243 magSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 18 ) & 0x07 ) ;
22442244 PressureResolution = ( int ) ( ( ConfigSetupByte0 >> 28 ) & 0x03 ) ;
22452245 GSRRange = ( int ) ( ( ConfigSetupByte0 >> 25 ) & 0x07 ) ;
@@ -2275,12 +2275,12 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
22752275 {
22762276 LowPowerAccelEnabled = true ;
22772277 }
2278- /*
2279- if ((Mpu9150SamplingRate == 0xFF && ADCRawSamplingRateValue < 3200) )
2278+
2279+ if ( GyroSamplingRate == 0x01 )
22802280 {
22812281 LowPowerGyroEnabled = true ;
22822282 }
2283- */
2283+
22842284 }
22852285
22862286
@@ -2313,7 +2313,7 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
23132313 GyroRange = ( int ) ( ( ConfigSetupByte0 >> 16 ) & 0x03 ) ;
23142314 MagGain = ( int ) ( ( ConfigSetupByte0 >> 21 ) & 0x07 ) ;
23152315 AccelSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 4 ) & 0xF ) ;
2316- Mpu9150SamplingRate = ( int ) ( ( ConfigSetupByte0 >> 8 ) & 0xFF ) ;
2316+ GyroSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 8 ) & 0xFF ) ;
23172317 magSamplingRate = ( int ) ( ( ConfigSetupByte0 >> 18 ) & 0x07 ) ;
23182318 PressureResolution = ( int ) ( ( ConfigSetupByte0 >> 28 ) & 0x03 ) ;
23192319 GSRRange = ( int ) ( ( ConfigSetupByte0 >> 25 ) & 0x07 ) ;
@@ -2332,32 +2332,12 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
23322332 LowPowerAccelEnabled = true ;
23332333 }
23342334
2335- if ( ( Mpu9150SamplingRate == 0xFF && ADCRawSamplingRateValue < 3200 ) )
2335+ if ( ( GyroSamplingRate == 0xFF && ADCRawSamplingRateValue < 3200 ) )
23362336 {
23372337 LowPowerGyroEnabled = true ;
23382338 }
23392339 }
23402340
2341- if ( HardwareVersion == ( int ) ShimmerBluetooth . ShimmerVersion . SHIMMER3R )
2342- {
2343- if ( magSamplingRate == 0 ) //3200 us the raw ADC value and not in HZ
2344- {
2345- LowPowerMagEnabled = true ;
2346- }
2347-
2348- if ( ( AccelSamplingRate == 1 ) )
2349- {
2350- LowPowerAccelEnabled = true ;
2351- }
2352- /*
2353- if ((Mpu9150SamplingRate == 0xFF && ADCRawSamplingRateValue < 3200))
2354- {
2355- LowPowerGyroEnabled = true;
2356- }
2357- */
2358- }
2359-
2360-
23612341 NumberofChannels = ( int ) packet [ 6 ] ;
23622342 BufferSize = ( int ) packet [ 7 ] ;
23632343 ListofSensorChannels . Clear ( ) ;
@@ -5414,9 +5394,9 @@ public int GetMpu9150AccelRange()
54145394 {
54155395 return Mpu9150AccelRange ;
54165396 }
5417- public int GetMpu9150SamplingRate ( )
5397+ public int GetGyroSamplingRate ( )
54185398 {
5419- return Mpu9150SamplingRate ;
5399+ return GyroSamplingRate ;
54205400 }
54215401
54225402 public int GetAccelRange ( )
@@ -6376,7 +6356,7 @@ protected void WriteGyroSamplingRate(int rate)
63766356 {
63776357 if ( HardwareVersion == ( int ) ShimmerVersion . SHIMMER3 || HardwareVersion == ( int ) ShimmerVersion . SHIMMER3R )
63786358 {
6379- Mpu9150SamplingRate = rate ;
6359+ GyroSamplingRate = rate ;
63806360 mTempIntValue = rate ;
63816361 WriteBytes ( new byte [ 2 ] { ( byte ) PacketTypeShimmer3 . SET_MPU9150_SAMPLING_RATE_COMMAND , ( byte ) rate } , 0 , 2 ) ;
63826362 System . Threading . Thread . Sleep ( 200 ) ;
0 commit comments