Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Shimmer32FeetAPI/ShimmerSDBT32Feet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ public void SdConfigWrite()
file.WriteLine("gs_range=" + GetGSRRange());
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
file.WriteLine("gyro_range=" + GetGyroRange());
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
file.WriteLine("acc_range=" + GetAccelRange());
file.WriteLine("acc_lpm=" + GetAccelLPBit());
file.WriteLine("acc_hrm=" + GetAccelHRBit());
Expand Down
25 changes: 14 additions & 11 deletions ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public abstract class ShimmerBluetooth : ShimmerDevice
protected int MagGain;
protected int LNAccelRange;
protected int AccelSamplingRate;
protected int Mpu9150SamplingRate;
protected int GyroSamplingRate;
protected int AltAccelSamplingRate;
protected int AltMagSamplingRate;
protected long ConfigSetupByte0; // for Shimmer2
Expand Down Expand Up @@ -2238,7 +2238,7 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
GyroRange = (int)((ConfigSetupByte0 >> 16) & 0x03);
MagGain = (int)((ConfigSetupByte0 >> 21) & 0x07);
AccelSamplingRate = (int)((ConfigSetupByte0 >> 4) & 0xF);
Mpu9150SamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
GyroSamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
magSamplingRate = (int)((ConfigSetupByte0 >> 18) & 0x07);
PressureResolution = (int)((ConfigSetupByte0 >> 28) & 0x03);
GSRRange = (int)((ConfigSetupByte0 >> 25) & 0x07);
Expand Down Expand Up @@ -2274,10 +2274,14 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
{
LowPowerAccelEnabled = true;
}

}


if (GyroSamplingRate == 0x01)
{
LowPowerGyroEnabled = true;
}

}

NumberofChannels = (int)packet[6 + 3];
BufferSize = (int)packet[7 + 3];
ListofSensorChannels.Clear();
Expand Down Expand Up @@ -2307,7 +2311,7 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
GyroRange = (int)((ConfigSetupByte0 >> 16) & 0x03);
MagGain = (int)((ConfigSetupByte0 >> 21) & 0x07);
AccelSamplingRate = (int)((ConfigSetupByte0 >> 4) & 0xF);
Mpu9150SamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
GyroSamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
magSamplingRate = (int)((ConfigSetupByte0 >> 18) & 0x07);
PressureResolution = (int)((ConfigSetupByte0 >> 28) & 0x03);
GSRRange = (int)((ConfigSetupByte0 >> 25) & 0x07);
Expand All @@ -2326,13 +2330,12 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
LowPowerAccelEnabled = true;
}

if ((Mpu9150SamplingRate == 0xFF && ADCRawSamplingRateValue < 3200))
if ((GyroSamplingRate == 0xFF && ADCRawSamplingRateValue < 3200))
{
LowPowerGyroEnabled = true;
}
}


NumberofChannels = (int)packet[6];
BufferSize = (int)packet[7];
ListofSensorChannels.Clear();
Expand Down Expand Up @@ -5390,9 +5393,9 @@ public int GetMpu9150AccelRange()
{
return Mpu9150AccelRange;
}
public int GetMpu9150SamplingRate()
public int GetGyroSamplingRate()
{
return Mpu9150SamplingRate;
return GyroSamplingRate;
}

public int GetAccelRange()
Expand Down Expand Up @@ -6352,7 +6355,7 @@ protected void WriteGyroSamplingRate(int rate)
{
if (HardwareVersion == (int)ShimmerVersion.SHIMMER3 || HardwareVersion == (int)ShimmerVersion.SHIMMER3R)
{
Mpu9150SamplingRate = rate;
GyroSamplingRate = rate;
mTempIntValue = rate;
WriteBytes(new byte[2] { (byte)PacketTypeShimmer3.SET_MPU9150_SAMPLING_RATE_COMMAND, (byte)rate }, 0, 2);
System.Threading.Thread.Sleep(200);
Expand Down
2 changes: 1 addition & 1 deletion ShimmerAPI/ShimmerAPI/ShimmerLogAndStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ public void SdConfigWrite()
file.WriteLine("gs_range=" + GetGSRRange());
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
file.WriteLine("gyro_range=" + GetGyroRange());
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
file.WriteLine("acc_range=" + GetAccelRange());
file.WriteLine("acc_lpm=" + GetAccelLPBit());
file.WriteLine("acc_hrm=" + GetAccelHRBit());
Expand Down
2 changes: 1 addition & 1 deletion ShimmerAPI/ShimmerAPI/ShimmerSDBT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ public void SdConfigWrite()
file.WriteLine("gs_range=" + GetGSRRange());
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
file.WriteLine("gyro_range=" + GetGyroRange());
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
file.WriteLine("acc_range=" + GetAccelRange());
file.WriteLine("acc_lpm=" + GetAccelLPBit());
file.WriteLine("acc_hrm=" + GetAccelHRBit());
Expand Down
Loading