Read with map - PalladinoMarco/AlignedJoystick GitHub Wiki

In the Basic Usage page we have already seen how to read the values of the joystick, but there is still one thing you do not know!

The read() method has an overload that allows you to add two parameters: the minimum and the maximum output value. This will allow us to achieve a new scale of the values of our joystick while keeping the axes aligned.

uint16_t read(axis_t axis, int32_t out_min, int32_t out_max)

Is very simple, it is an integrated map. Read this documentation (Arduino map()) and then resume this reading.

In practice, the Arduino map() is integrated in the read() method, if you want to get the same function without losing the alignment of your calibrated axes will simply add the two parameters of minimum and maximum output. Comfortable, isn’t it?

To learn more you can look at this example ServoControl.