Simple switch panel and throttle for Flight Sim

Thanks for all the help guys! I got it working today for what my purpose was. A simple control panel with 12 switches and 2 analog inputs.
image
It works as intended and i just need too finish welding my rudder pedals and throttle housing. (comment if u want me to keep tread up and post finished product)

Here is the code that got it working for me. i borrowed parts of sketches and built it together.

#include <Joystick.h>

Joystick_ Joystick(0x03, 0x04, 12, false, false, false, false, true, true, false, false, true, false, false, false );

void setup() {
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);      //12
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  pinMode(13, INPUT_PULLUP);
Joystick.begin();
}

int lastButtonState[12] = {0,0,0,0,0,0,0,0,0,0,0,0};

const int pinToButtonMap = 2;

void loop() {
Joystick.setThrottle(analogRead(A0));
Joystick.setRxAxis(analogRead(A1));
for (int index = 0; index < 12; index++)
  {
    int currentButtonState = !digitalRead(index + pinToButtonMap);
    if (currentButtonState != lastButtonState[index])
    {
      Joystick.setButton(index, currentButtonState);
      lastButtonState[index] = currentButtonState;
    }
  }

  delay(50);
}

I learned a lot about Arduino's in this days and it was a lot of fun. just gonna figure out what to do next i got a few Arduino UNOs from a buddy that i will try to tinker with.

I'd be interested to see the completed project.

Hello I've been away at work for some time but now I'm home and able to work on this project, so here is a quick and small update on my rudder pedals for the sim.

I just got done welding my first prototype from some scrap metal i had laying around (plz don't hate on the welds :sweat_smile:). so now I'm only waiting on the hall effect sensors so i can make them work as a axis in windows.


I'm open for feedback on something I'm doing wrong or could do better if u got any ideas.

I will be back in a day or two with mounting of the sensors and a proper panel for the switches and throttle.