Arduino Micro USB Joystick axis is +-Inf

I am using an Arduino Micro as an HID device. I read the buttons and axis values from an RC receiver and set them to the axis of a joystick using this library: ArduinoJoystickLibrary.

The buttons that I have mapped works perfectly in all Gamepad/Joystick viewers I've tried. However all axis are showing either +Infinity or -Infinity. The values do "work", as is if I move the sticks on my radio the values changes, but only jumping from +Inf to -Inf etc.

I am having trouble finding what could be causing this, does anyone have any ideas?

Here is the source code as well:

FrSkyJoystick.zip (798 Bytes)

The double map()ing isn't helping to increase the signal quality. So define the joystick range to (150,1850) and don't map yourself, the Joystick library does that anyway.

But that doesn't explain the behavior. You have a commented out block that prints the values to the serial interface. What values do you get there? Post some output you got while moving the sticks.

Inf often results from divide by 0. Check for that.