-
Notifications
You must be signed in to change notification settings - Fork 12
Configuring
jyong15 edited this page Oct 14, 2021
·
4 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);
The available configuration options are stored in a map in the ShimmerDevice class.
shimmer.getConfigOptionsMap();
The available config values and their corresponding mapping to GUI values can be found by inspecting the mConfigValues and mGuiValues variables inside each of the map's values (ConfigOptionDetailsSensor).