error 1

is there sombody that can help me whit this error 1
Arduino: 1.8.5 (Windows 8.1), Board:“Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)”

C:\Users\michelle\AppData\Local\Temp\Temp2_32-FUNCTION-BUTTON-BOX-master.zip\32-FUNCTION-BUTTON-BOX-master\ARDUINO_BUTTON_BOXV2\ARDUINO_BUTTON_BOXV2.ino:7:20: fatal error: Keypad.h: No such file or directory

#include <Keypad.h>

^

compilation terminated.

exit status 1
Fout bij het compileren voor board Arduino Pro or Pro Mini

i download this skech from sombody from youtube and i dont know how to program a ardiuno
thanks guys

It looks like you’re compiling inside the ZIP archive. Extract the file(s) and work on the extracted version.

https://www.youtube.com/watch?v=Z7Sc4MJ8RPM this is what i want to build https://github.com/AM-STUDIO/32-FUNCTION-BUTTON-BOX here i downloaded the skecht for the arduino i just extract the files on my main screen and try to upload it to the board i get the same error i am complete new whit arduinos

For Keypad.h In the IDE, sketch->include libraries->manage libraries. In the searchbox at the top, type keypad From the list, click the one by Mark Stanley and Alexaner Brevig Click install

For joystick.h, it might be this one: Joystick library Click clone or download (green button at the right) and select download zip. Extract the files. In the extracted directory, navigate to C:\Users\yourusername\Downloads\arduinolibs\ArduinoJoystickLibrary-master\ArduinoJoystickLibrary-master. In there you will find a directory Joystick; copy it.

Navigate to C:\Users\yourusername\Documents\Arduino\libraries and paste the copied directory.

You might have to restart the IDE after that. Now try to compile.

1 Like

ok i did what you say and that works i think but now i get new errors
Arduino: 1.8.5 (Windows 8.1), Board:“Arduino/Genuino Micro”

ARDUINO_BUTTON_BOXV2:95: error: ‘Keypad’ does not name a type

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

^

C:\Users\michelle\Desktop\32-FUNCTION-BUTTON-BOX-master\ARDUINO_BUTTON_BOXV2\ARDUINO_BUTTON_BOXV2.ino: In function ‘void CheckAllButtons()’:

ARDUINO_BUTTON_BOXV2:115: error: ‘buttbx’ was not declared in this scope

if (buttbx.getKeys())

^

ARDUINO_BUTTON_BOXV2:117: error: ‘LIST_MAX’ was not declared in this scope

for (int i=0; i<LIST_MAX; i++)

^

ARDUINO_BUTTON_BOXV2:122: error: ‘PRESSED’ was not declared in this scope

case PRESSED:

^

ARDUINO_BUTTON_BOXV2:123: error: ‘HOLD’ was not declared in this scope

case HOLD:

^

ARDUINO_BUTTON_BOXV2:126: error: ‘RELEASED’ was not declared in this scope

case RELEASED:

^

ARDUINO_BUTTON_BOXV2:127: error: ‘IDLE’ was not declared in this scope

case IDLE:

^

exit status 1
‘Keypad’ does not name a type

Dit rapport zou meer informatie bevatten met
“Uitgebreide uitvoer weergeven tijden compilatie”
optie aan in Bestand → Voorkeuren.

Please insert your code in the next post

Type ``` [code] ```

Paste your code after that Type ``` [/code] ``` after that

This is the code that I downloaded. I don't have a micro but it compiles for a Leonardo (same processor).

what do you mean whit code? the error or… ? sorry i am completly new on this

The source code that produces the error (in code tags) AND the error

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

this is the code that is marked

Arduino: 1.8.5 (Windows 8.1), Board:“Arduino/Genuino Micro”

ARDUINO_BUTTON_BOXV2:99: error: ‘Keypad’ does not name a type

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

^

C:\Users\michelle\Desktop\32-FUNCTION-BUTTON-BOX-master\ARDUINO_BUTTON_BOXV2\ARDUINO_BUTTON_BOXV2.ino: In function ‘void CheckAllButtons()’:

ARDUINO_BUTTON_BOXV2:119: error: ‘buttbx’ was not declared in this scope

if (buttbx.getKeys())

^

ARDUINO_BUTTON_BOXV2:121: error: ‘LIST_MAX’ was not declared in this scope

for (int i=0; i<LIST_MAX; i++)

^

ARDUINO_BUTTON_BOXV2:126: error: ‘PRESSED’ was not declared in this scope

case PRESSED:

^

ARDUINO_BUTTON_BOXV2:127: error: ‘HOLD’ was not declared in this scope

case HOLD:

^

ARDUINO_BUTTON_BOXV2:130: error: ‘RELEASED’ was not declared in this scope

case RELEASED:

^

ARDUINO_BUTTON_BOXV2:131: error: ‘IDLE’ was not declared in this scope

case IDLE:

^

Meerdere bibliotheken gevonden voor “Joystick.h”
Gebruikt: C:\Users\michelle\Documents\Arduino\libraries\Joystick
Niet gebruikt: C:\Program Files (x86)\Arduino\libraries\Joystick
exit status 1
‘Keypad’ does not name a type

Dit rapport zou meer informatie bevatten met
“Uitgebreide uitvoer weergeven tijden compilatie”
optie aan in Bestand → Voorkeuren.

ALL the source code

AWOL: ALL the source code

ALL 4000-something characters ;)

The limit for a post is 9000 characters; minus the above 4000-something leaves roughly 5000 for the errors.

If the errors are more than 9000 characters, save it to a text file and attach it here. If it's more than roughly 4800 but less than 9000, use a second post (yes, we are aware of your one post per 5 minutes limitation)

ok i did somting wrong whit pasting the joystick map.

Arduino: 1.8.5 (Windows 10), Board:"Arduino/Genuino Uno"

In file included from C:\Users\AMD\Desktop\32-FUNCTION-BUTTON-BOX-master\ARDUINO_BUTTON_BOXV2\ARDUINO_BUTTON_BOXV2.ino:1:0:

C:\Users\AMD\Documents\Arduino\libraries\Joystick\src/Joystick.h:32:2: error: #error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).

error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).

^

exit status 1 Fout bij het compileren voor board Arduino/Genuino Uno

Dit rapport zou meer informatie bevatten met "Uitgebreide uitvoer weergeven tijden compilatie" optie aan in Bestand -> Voorkeuren. this is wat i get now

You now selected the wrong board; it will only work with the boards given in the error message. Which board do you use?

And still no source code !

ok i see. i work whit a arduino pro micro i think i chinees version i gonna try to change the board thx in advancd

//BUTTON BOX 
//USE w ProMicro
//Tested in WIN10 + Assetto Corsa
//AMSTUDIO
//20.8.17

#include <Keyboard.h>
#include <Joystick.h>

#define ENABLE_PULLUPS
#define NUMROTARIES 4
#define NUMBUTTONS 24
#define NUMROWS 5
#define NUMCOLS 5


byte buttons[NUMROWS][NUMCOLS] = {
  {0,1,2,3,4},
  {5,6,7,8,9},
  {10,11,12,13,14},
  {15,16,17,18,19},
  {20,21,22,23},
};

struct rotariesdef {
  byte pin1;
  byte pin2;
  int ccwchar;
  int cwchar;
  volatile unsigned char state;
};

rotariesdef rotaries[NUMROTARIES] {
  {0,1,24,25,0},
  {2,3,26,27,0},
  {4,5,28,29,0},
  {6,7,30,31,0},
};

#define DIR_CCW 0x10
#define DIR_CW 0x20
#define R_START 0x0

#ifdef HALF_STEP
#define R_CCW_BEGIN 0x1
#define R_CW_BEGIN 0x2
#define R_START_M 0x3
#define R_CW_BEGIN_M 0x4
#define R_CCW_BEGIN_M 0x5
const unsigned char ttable[6][4] = {
  // R_START (00)
  {R_START_M,            R_CW_BEGIN,     R_CCW_BEGIN,  R_START},
  // R_CCW_BEGIN
  {R_START_M | DIR_CCW, R_START,        R_CCW_BEGIN,  R_START},
  // R_CW_BEGIN
  {R_START_M | DIR_CW,  R_CW_BEGIN,     R_START,      R_START},
  // R_START_M (11)
  {R_START_M,            R_CCW_BEGIN_M,  R_CW_BEGIN_M, R_START},
  // R_CW_BEGIN_M
  {R_START_M,            R_START_M,      R_CW_BEGIN_M, R_START | DIR_CW},
  // R_CCW_BEGIN_M
  {R_START_M,            R_CCW_BEGIN_M,  R_START_M,    R_START | DIR_CCW},
};
#else
#define R_CW_FINAL 0x1
#define R_CW_BEGIN 0x2
#define R_CW_NEXT 0x3
#define R_CCW_BEGIN 0x4
#define R_CCW_FINAL 0x5
#define R_CCW_NEXT 0x6

const unsigned char ttable[7][4] = {
  // R_START
  {R_START,    R_CW_BEGIN,  R_CCW_BEGIN, R_START},
  // R_CW_FINAL
  {R_CW_NEXT,  R_START,     R_CW_FINAL,  R_START | DIR_CW},
  // R_CW_BEGIN
  {R_CW_NEXT,  R_CW_BEGIN,  R_START,     R_START},
  // R_CW_NEXT
  {R_CW_NEXT,  R_CW_BEGIN,  R_CW_FINAL,  R_START},
  // R_CCW_BEGIN
  {R_CCW_NEXT, R_START,     R_CCW_BEGIN, R_START},
  // R_CCW_FINAL
  {R_CCW_NEXT, R_CCW_FINAL, R_START,     R_START | DIR_CCW},
  // R_CCW_NEXT
  {R_CCW_NEXT, R_CCW_FINAL, R_CCW_BEGIN, R_START},
};
#endif

byte rowPins[NUMROWS] = {21,20,19,18,15}; 
byte colPins[NUMCOLS] = {14,16,10,9,8}; 

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<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;
            }
           }   
         }
     }
}


void rotary_init() {
  for (int i=0;i<NUMROTARIES;i++) {
    pinMode(rotaries[i].pin1, INPUT);
    pinMode(rotaries[i].pin2, INPUT);
    #ifdef ENABLE_PULLUPS
      digitalWrite(rotaries[i].pin1, HIGH);
      digitalWrite(rotaries[i].pin2, HIGH);
    #endif
  }
}


unsigned char rotary_process(int _i) {
   unsigned char pinstate = (digitalRead(rotaries[_i].pin2) << 1) | digitalRead(rotaries[_i].pin1);
  rotaries[_i].state = ttable[rotaries[_i].state & 0xf][pinstate];
  return (rotaries[_i].state & 0x30);
}

void CheckAllEncoders(void) {
  for (int i=0;i<NUMROTARIES;i++) {
    unsigned char result = rotary_process(i);
    if (result == DIR_CCW) {
      Joystick.setButton(rotaries[i].ccwchar, 1); delay(50); Joystick.setButton(rotaries[i].ccwchar, 0);
    };
    if (result == DIR_CW) {
      Joystick.setButton(rotaries[i].cwchar, 1); delay(50); Joystick.setButton(rotaries[i].cwchar, 0);
    };
  }
}

i changed the board now i get the fault code again from keypad

Because you have include Keyboard.h; it's not the same thing.

i changed the board now i get the fault code again from keypad

yOU rEALLY sHOULD gET yOUR sHIFT kEY fIXED.

You do NOT get a "fault code" from keypad. You MIGHT get an error message that the compiler doesn't know what a Keypad is, but that's to be expected since you haven't told it what a Keypad is. Are you missing a #include statement?

No, incorrect include ;) The original code includes Keypad.h

ok its done. i dindt see keyboard keypad :D. thank you guys for youre help it was verry usefull thankss