You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ShimmerECGConsoleAppExample/ShimmerConsoleAppExample/Program.cs
+53-7Lines changed: 53 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ public void start()
35
35
byte[]defaultECGReg1=ShimmerBluetooth.SHIMMER3_DEFAULT_ECG_REG1;//also see ShimmerBluetooth.SHIMMER3_DEFAULT_TEST_REG1 && ShimmerBluetooth.SHIMMER3_DEFAULT_EMG_REG1
36
36
byte[]defaultECGReg2=ShimmerBluetooth.SHIMMER3_DEFAULT_ECG_REG2;//also see ShimmerBluetooth.SHIMMER3_DEFAULT_TEST_REG2 && ShimmerBluetooth.SHIMMER3_DEFAULT_EMG_REG2
37
37
//The constructor below allows the user to specify the shimmer configurations which is set upon connection to the device
//Note that it is better to set the exgrate via writesamplingrate, a value of 2 is 500 SPS, it should actually be 3 1000 SPS for a sampling rate of 512Hz
56
-
shimmer.WriteEXGRate(2);
57
-
shimmer.WriteEXGGain(1);
54
+
System.Console.WriteLine("\n");
55
+
56
+
//Note the data rate of the EXG chips (exgrate) is automatically set via writesamplingrate(). For a sampling rate of 512Hz, the exgrate is set to 0x03, which corresponds to 1000 SPS.
57
+
//The exgrate can be set to a different settting afterwards, e.g. to 2000 SPS:
58
+
shimmer.WriteEXGRate(4);
59
+
60
+
//The gain of the EXG chips is also configurable. The default gain = 4 (0x04). Now the gain is set to 0x05, which corresponds to a gain of 8:
//Example code for changing the ecg resolution from 24bit to 16bit - to limit the amount of data transmitted over the Bluetooth link
74
78
enabledSensors=((int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_EXG1_16BIT|(int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_EXG2_16BIT);// this is to enable the two EXG Chips on the Shimmer3 at 16 bit resolution
75
79
shimmer.WriteSensors(enabledSensors);
76
80
81
+
//Example code for changing the ecg resolution back to 24bit - recommended
82
+
enabledSensors=((int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_EXG1_24BIT|(int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_EXG2_24BIT);// this is to enable the two EXG Chips on the Shimmer3 at 24 bit resolution
83
+
shimmer.WriteSensors(enabledSensors);
84
+
85
+
//Example code for setting the default ecg settings again (exggain = 4, exgrate >= sampling rate)
86
+
//First write the default register settings for both EXG chips
0 commit comments