Game Controller

Hi all, I have looked far and wide for help but I think I need some more step by step help. I am trying to make a 14 button gaming controller using an Arduino Pro Micro. I have 12 of the buttons grounded together, and the other pins connected to 2-7 and A3-A0, 14 and 15. the other 2 buttons are connected to pins 8 and 14, and they are grounded to the pin next to them.
I am trying to use the code included here (Formula B1 - (Sim racing) steering wheel by bremme - Thingiverse) but I get an error saying "'JOYSTICK_DEFAULT_REPORT_ID' was not declared in this scope"

I know this is a long help request, but I am lost. thanks for any help!

hid_joystick_formula_b1.ino (1.88 KB)

The code posted in the preferred way

/*

$ lsusb
2341:8037 Arduino SA

idVendor                0x2341 Arduino SA
idProduct               0x8037
iManufacturer           1 Arduino LLC
iProduct                2 Arduino Micro


.build.usb_manufacturer

*/

#include <Joystick.h>
#include "Switch.h"


const uint32_t SAMPLE_TIME_MS = 20;

// Normal buttons
const uint8_t TOTAL_BUTTONS = 14;   // 6 left, 6 right, 2 shifter
Switch buttons[TOTAL_BUTTONS];
bool previousButtonState[TOTAL_BUTTONS];
const uint8_t BUTTON_PINS[TOTAL_BUTTONS] =
{
  2,   3,  4,  5,  6,  7,
  21, 20, 19, 18, 15, 14,
  8, 16
};

Joystick_ Joystick(
  JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK,
  TOTAL_BUTTONS, 0,       // Button Count, Hat Switch Count
  false, false, false,    // no X, Y and Z Axis
  false, false, false,    // No Rx, Ry, or Rz
  false, false,           // No rudder or throttle
  false, false, false     // No accelerator, brake, or steering
);

void setup(void)
{
  Joystick.begin(false);
  // Serial.begin(115200);
  for (uint8_t i = 0; i < TOTAL_BUTTONS; i++)
  {
    previousButtonState[i] = false;
    pinMode(BUTTON_PINS[i], INPUT_PULLUP);
  };
  // Set shifter GND low
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  digitalWrite(9, LOW);
  digitalWrite(10, LOW);
};

void loop(void)
{
  static uint32_t previousTime = millis();
  static uint32_t buttonState = 0;
  // Map 14 normal buttons
  for (uint8_t i = 0; i < TOTAL_BUTTONS; i++)
  {
    buttons[i].update(!digitalRead(BUTTON_PINS[i]));
    if (buttons[i].on() != previousButtonState[i])
    {
      Joystick.setButton(i, buttons[i].on());
    }
    previousButtonState[i] = buttons[i].on();
    // Serial.print(buttons[i].on());
  };
  // Serial.println();
  // Send new state to the host
  if (millis() - previousTime > SAMPLE_TIME_MS)
  {
    Joystick.sendState();
    previousTime = millis();
  };
  // delay(SAMPLE_TIME_MS);
};

Please note the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here

apologies, im new here