I'm currently planning on making an arcade controller, using an arduino nano to control 16 WS2812Bs to make a lights effects on the buttons. I got idea to take it one step further; use arduino to reduce the number of physical buttons by implementing something like a shift button, so all button presses first go through the arduino, decided the appropriate output, then send the output to the main PCB. The main PCB reads button presses on active low.
I think the whole project is relatively simple, but this is my first arduino project, so there are still a lot of things I don't understand.
The idea I got so far:
There will be 7 buttons + 1 shift button. I would need 7 pins to detect the buttons, 14 pins for the simulated button presses to the main PCB, 1 pin for the shift button, and 1 pin for LED controlling. Takes 23 pins, which is too much for a Nano. I'm thinking of using a 74hc165, so all the 8 physical buttons are connected to 165 which requires 3 SPI pins, 14 pins to send simulated button presses, and 1 pin for LED controlling, for a total of 18 pins.
The original PCB detects a button press when a signal line is driven low. I've read up that to simulate this, I would need set pinmode() to switch between input and output mode to simulate open/closed circuit.
LED controller will be done either using the neopixel or fastled library. I don't know which is faster and better yet.
My main concern is, since the controller is meant for fighting games, all these processes must not introduce noticable input delay. Since the games are 60FPS, a single frame is 16ms, taking into consideration the delay from the main PCB itself, I want a single loop to not be longer than 2ms, preferably lower than 1 ms. This single loop would contain: reading 8 bits of data from 165, changing the pinmodes for 14 pins to simulate button press according to the data read previously, and control 16 LEDs. Is the arduino fast enough for all these process to happen in less than 1ms, or at least 2ms? Mainly because I don't know how fast/slow is pinmode() and how fast/slow is reading 8 bits from 165.
Can anyone give insight on how feasible this project is? Thanks.