Arduino (a function-definition is not allowed here before '{' token) i dont see the mistake : <p>im not seeing the problem pls help me
 there was more code for the button box originally but i trimmed the encoders out</p>

<p>Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Micro"</p>

<p>Build options changed, rebuilding all
28.01.2018\Arduino\ARDUINO_BUTTON_BOXV2a\ARDUINO_BUTTON_BOXV2a.ino: In function 'void setup()':</p>

<p>ARDUINO_BUTTON_BOXV2a:103:13: error: a function-definition is not allowed here before '{' token</p>

<p>void loop() { </p>

<pre><code>         ^
</code></pre>

<p>ARDUINO_BUTTON_BOXV2a:111:29: error: a function-definition is not allowed here before '{' token</p>

<p>void CheckAllButtons(void)  {</p>

<pre><code>                         ^
</code></pre>

<p>ARDUINO_BUTTON_BOXV2a:133:1: error: expected '}' at end of input</p>

<p>}</p>

<p>^</p>

<p>exit status 1
a function-definition is not allowed here before '{' token</p>

<p>This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.</p>

<pre><code>#include &lt;Keypad.h&gt;
#include &lt;Joystick.h&gt;

#define ENABLE_PULLUPS
#define NUMROTARIES 0
#define NUMBUTTONS 16
#define NUMROWS 4
#define NUMCOLS 4


byte buttons[NUMROWS][NUMCOLS] = {
  {0,1,2,3},
  {4,5,6,7},
  {8,9,10,11},
  {12,13,14,15},
};

byte rowPins[NUMROWS] = {15,14,16,10}; 
byte colPins[NUMCOLS] = {A3,A2,A1,A0}; 

Keypad buttbx = Keypad( makeKeymap(buttons), rowPins, colPins, NUMROWS, NUMCOLS); 

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, 
  JOYSTICK_TYPE_JOYSTICK, 32, 0,
  false, false, false, false, false, false,
  false, false, false, false, false);

void setup() {
  Joystick.begin();
 // rotary_init();}

void loop() { 

 // CheckAllEncoders();

  CheckAllButtons();

}

void CheckAllButtons(void)  {

      if (buttbx.getKeys())
    {
       for (int i=0; i&lt;LIST_MAX; i++)   
        {
           if ( buttbx.key[i].stateChanged )   
            {
            switch (buttbx.key[i].kstate) {  
                    case PRESSED:
                    case HOLD:
                              Joystick.setButton(buttbx.key[i].kchar, 1);
                              break;
                    case RELEASED:
                    case IDLE:
                              Joystick.setButton(buttbx.key[i].kchar, 0);
                              break;
            }
           }   
         }
     }

}
</code></pre>
