[SOLVED]Arcade trackball to usb mouse help

A lot of questions...
Adding more encoders is possible but it may impact the performance of the first 2 encoders. From the encoder page I linked it...

Encoders have 2 signals, which must be connected to 2 pins. There are three options.
Best Performance: Both signals connect to interrupt pins.
Good Performance: First signal connects to an interrupt pin, second to a non-interrupt pin.
Low Performance: Both signals connect to non-interrupt pins, details below.

I would then suggest change to the 'good performance' model and have one encoder pin connected to an interrupt pin (pins 0-3) instead of the current two pins.

The button reading code was only for testing the joystick library worked as expected and is not really suitable for more buttons like this as it cannot cope well non contiguous pin numbers, as you have found.
I suggest putting the button pin numbers into an array and then using that array to configure the pins and read them.

A dead zone might not be so important if you can make the trackball act like an analogue joystick as the off axis values will be small when rolling in a single direction compared to the test code that makes any movement in any axis a full joystick axis move.
A possible way to do the acceleration is to count the number of changes in an axis within a fixed time interval as this will be higher the faster the encoder is rotated, you then map this change value to the amount of joystick movement.
I don't have the hardware to check what value you would get for this so you will need to work on this (with a bit of help).
I would start with loading the original encoder code posted on the library web page that prints the encoder changes to the Serial monitor and then modify it to suit your encoder pins and time interval, and run it.
Start turning the encoder at a fixed speed that sort of matches your minimum joystick movement so you get several results printed in the serial monitor and then do the same at the speed you would expect for full joystick movement. This should give an idea of the min/max values used for acceleration.
Once you have that the code can be altered to use it.
I will try to make time to change the code to suit more buttons and post it here but I'm working (or meant to be :slight_smile: so might not have time.