Skip to content

Configuring

JongChern edited this page Aug 9, 2018 · 5 revisions

Configuring

The recommended way of configuring a Shimmer devices is via the use of the Bluetooth Manager using clone devices The following are the recommended steps:

  1. Clone the Shimmer device – Note: a clone is a virtual copy of the Shimmer which you can freely configure without affecting the physical device.
  2. Configure the clone using “set” methods
  3. Generate a Shimmer config for the clone using: AssembleShimmerConfig.generateSingleShimmerConfig();
  4. Write the settings back from the clone to the physical Shimmer device using:
BluetoothManagerAndroid.configureShimmer(clone);

Please see the code below for an example of this:

//Step 1)
Shimmer clone = (Shimmer) shimmer.deepClone();  
//Step 2)
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_ANALOG_ACCEL, true);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_ACCEL, true);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO, false);
clone.setSensorEnabledState(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG, false);
clone.setShimmerAndSensorsSamplingRate(512);
clone.setAccelRange(1);
//Step 3)
AssembleShimmerConfig.generateSingleShimmerConfig(clone, Configuration.COMMUNICATION_TYPE.BLUETOOTH);
//Step 4)
btManager.configureShimmer(clone);

Clone this wiki locally