Repository navigation
Configuring
jyong15 edited this page Aug 29, 2018
·
5 revisions
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:
- Clone the Shimmer device – Note: a clone is a virtual copy of the Shimmer which you can freely configure without affecting the physical device.
- Configure the clone using “set” methods
- Generate a Shimmer config for the clone using: AssembleShimmerConfig.generateSingleShimmerConfig();
- 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);See below for an example on how to disable all sensors on a Shimmer device.
Integer[] sensorsIDsEnabled = {};
shimmer.setSensorIdsEnabled(sensorsIDsEnabled);