Skip to content

Commit e5525a5

Browse files
committed
Rebuilt ShimmerAPI.
- Rebuilt ShimmerAPI and added to lib folder of ECG and EXT test examples. - Minor changes to examples.
1 parent 820d8be commit e5525a5

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

ShimmerECGConsoleAppExample/ShimmerConsoleAppExample/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public void start()
4040
shimmer.Connect();
4141
if (shimmer.GetState() == ShimmerBluetooth.SHIMMER_STATE_CONNECTED)
4242
{
43+
System.Console.WriteLine("\n");
4344
System.Console.WriteLine("EXG CONFIGURATION SET USING SHIMMER CONSTRUCTOR");
4445
System.Console.WriteLine("EXG CHIP 1 CONFIGURATION");
4546
for (int i = 0; i < 10; i++)
Binary file not shown.

ShimmerEXGConsoleAppExample/ShimmerConsoleAppExample/Program.cs

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Text;
6+
using System.Threading;
67
using System.Threading.Tasks;
78

89
namespace ShimmerConsoleAppExample
@@ -37,7 +38,7 @@ public void start()
3738
byte[] defaultECGReg1 = ShimmerBluetooth.SHIMMER3_DEFAULT_TEST_REG1; //also see ShimmerBluetooth.SHIMMER3_DEFAULT_ECG_REG1 && ShimmerBluetooth.SHIMMER3_DEFAULT_EMG_REG1
3839
byte[] defaultECGReg2 = ShimmerBluetooth.SHIMMER3_DEFAULT_TEST_REG2; //also see ShimmerBluetooth.SHIMMER3_DEFAULT_ECG_REG2 && ShimmerBluetooth.SHIMMER3_DEFAULT_EMG_REG2
3940
//The constructor below allows the user to specify the shimmer configurations which is set upon connection to the device
40-
shimmer = new ShimmerLogAndStreamSystemSerialPort("ShimmerID1", "COM29", samplingRate, 0, 4, enabledSensors, false, false, false, 0, 0, defaultECGReg1, defaultECGReg2, false);
41+
shimmer = new ShimmerLogAndStreamSystemSerialPort("ShimmerID1", "COM169", samplingRate, 0, 4, enabledSensors, false, false, false, 0, 0, defaultECGReg1, defaultECGReg2, false);
4142
shimmer.UICallback += this.HandleEvent;
4243
shimmer.Connect();
4344
if (shimmer.GetState() == ShimmerBluetooth.SHIMMER_STATE_CONNECTED)
@@ -53,29 +54,14 @@ public void start()
5354
{
5455
System.Console.Write(shimmer.GetEXG2RegisterContents()[i] + " ");
5556
}
56-
System.Console.WriteLine();
57-
shimmer.WriteEXGRate(1); //Note that it is better to set the exgrate via writesamplingrate
58-
shimmer.WriteEXGGain(0);
59-
60-
shimmer.ReadEXGConfigurations(1);
61-
shimmer.ReadEXGConfigurations(2);
62-
System.Console.WriteLine("EXG CONFIGURATION AFTER MANUALLY SETTING THE VALUES (RATE and GAIN)");
63-
System.Console.WriteLine("EXG CHIP 1 CONFIGURATION");
64-
for (int i = 0; i < 10; i++)
65-
{
66-
System.Console.Write(shimmer.GetEXG1RegisterContents()[i] + " ");
67-
}
68-
System.Console.WriteLine("\nEXG CHIP 2 CONFIGURATION");
69-
for (int i = 0; i < 10; i++)
70-
{
71-
System.Console.Write(shimmer.GetEXG2RegisterContents()[i] + " ");
72-
}
73-
System.Console.WriteLine();
74-
75-
//EXAMPLE TO CHANGE ECG RESOLUTION
76-
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
57+
System.Console.WriteLine("\n");
58+
7759
shimmer.WriteSensors(enabledSensors);
7860

61+
System.Console.WriteLine("IN ABOUT 5 SECONDS STREAMING WILL START AFTER THE BEEP");
62+
Thread.Sleep(5000);
63+
System.Console.Beep();
64+
7965
shimmer.StartStreaming();
8066
}
8167
}
@@ -111,7 +97,8 @@ public void HandleEvent(object sender, EventArgs args)
11197
break;
11298
case (int)ShimmerBluetooth.ShimmerIdentifier.MSG_IDENTIFIER_DATA_PACKET:
11399
ObjectCluster objectCluster = (ObjectCluster)eventArgs.getObject();
114-
SensorData data = objectCluster.GetData(Shimmer3Configuration.SignalNames.EXG1_CH1_16BIT, "CAL");
100+
//SensorData data = objectCluster.GetData(Shimmer3Configuration.SignalNames.EXG1_CH1_16BIT, "CAL");
101+
SensorData data = objectCluster.GetData(Shimmer3Configuration.SignalNames.EXG1_CH1, "CAL");
115102
System.Console.WriteLine("EXG Channel 1: " + data.Data);
116103
logging.WriteData(objectCluster);
117104
break;
Binary file not shown.

0 commit comments

Comments
 (0)