Skip to content

Configurator

dbankieris edited this page Jul 11, 2016 · 1 revision

IDF encourages heavy use of normalized values. The Input::getNormalizedValue() function allows retrieval of a device's input normalized to the range [-1, 1] regardless of what the actual raw range is. This simplifies code that deals with Inputs by providing a standard value range. However, to calculate the normalized value, IDF needs to know the raw ranges for each input. Default ranges are provided for each device in its InputLayout class which are usually close enough to use a device reasonably well out of the box. However, actual raw ranges often vary across identical physical devices and can even change throughout the lifetime of a single device. To obtain the highest accuracy for normalized values, each device's ranges should be individually set via SingleInput::configure or SingleInput's constructor. IDF's configurator tool can help you determine each input's range and also provides example Python code to affect the changes.

Compiling

In the apps/configurator directory, run make. This should produce an executable named configurator.

Running

When executed, the configurator will emit a note about Device Permissions. If you have a USB or Bluetooth device that is connected and supported by IDF but is not listed, you probably need to broaden its permissions.

Upon selecting a device, the configurator will list each configurable input and continuously update the current values. Note that not all inputs are configurable. For instance, it doesn't make sense to configure a button that only has two states. So don't be surprised if a bunch of inputs are missing from the list. Each device decides which inputs it makes sense to configure.

For each input, push/pull the device as far as it will go in each direction. You want to reach maximum deflection on both ends to obtain the minimum and maximum raw values. As you move the device, IDF will update the minimum and maximum values you have achieved for each input.

When you've exercised the full range of the device, press Enter, and the configurator will print example Python code for configuring the device according to the values you obtained.