# Error compiling for board Arduino Uno

**URL:** <https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248>\
**Category:** General Guidance\
**Created:** [April 8, 2024, 11:58am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248 "2024-04-08T11:58:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cholland00](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@cholland00](https://forum.arduino.cc/u/cholland00)\
**Post date:** [April 8, 2024, 11:58am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/1 "2024-04-08T11:58:50Z")

</div>

Hello,

First time usign Arduino. I have soem code that worked fine on Arduino cloud but is now not verifyign when i use the Arduino software. I am unable to transdefer the code form the cloud to my Uno as it is not compatible.

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

C:\Users\wjunior\Downloads\copy\_of\_password\_based\_door\_lock1\copy\_of\_password\_based\_door\_lock1.ino:1:20: fatal error: Keypad.h: No such file or directory

#include \<Keypad.h\>

```
                ^

```

compilation terminated.

exit status 1  
Error compiling for board Arduino/Genuino Uno.

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

```arduino
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Servo.h>

#define Password_Length 5

Servo myservo;
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);

int pos = 0;

char Data[Password_Length];
char Master[Password_Length] = "1234";
byte data_count = 0, master_count = 0;

bool Pass_is_good;
bool door = false;
char customKey;

/*---preparing keypad---*/

const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

byte rowPins[ROWS] = {0, 1, 2, 3};
byte colPins[COLS] = {4, 5, 6, 7};

Keypad customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);

/*--- Main Action ---*/
void setup()
{
  myservo.attach(9, 2000, 2400);
  ServoClose();
  lcd.begin(16, 2);
  lcd.print("Protected Door");
  loading("Loading");
  lcd.clear();
}

void loop()
{
  if (door == true)
  {
    customKey = customKeypad.getKey();
    if (customKey == '#')
    {
      lcd.clear();
      ServoClose();
      lcd.print("Door is closed");
      delay(3000);
      door = false;
    }
  }
  else
    Open();

}

void loading (char msg[]) {
  lcd.setCursor(0, 1);
  lcd.print(msg);

  for (int i = 0; i < 9; i++) {
    delay(1000);
    lcd.print(".");
  }
}

void clearData()
{
  while (data_count != 0)
  { 
    Data[data_count--] = 0;
  }
  return;
}

void ServoClose()
{
  for (pos = 90; pos >= 0; pos -= 10) { 
    myservo.write(pos);
  }
}

void ServoOpen()
{
  for (pos = 0; pos <= 90; pos += 10) {
    myservo.write(pos);  
  }
}

void Open()
{
  lcd.setCursor(0, 0);
  lcd.print("Enter Password");
  
  customKey = customKeypad.getKey();
  if (customKey)
  {
    Data[data_count] = customKey;
    lcd.setCursor(data_count, 1);
    lcd.print(Data[data_count]);
    data_count++;
  }

  if (data_count == Password_Length - 1)
  {
    if (!strcmp(Data, Master))
    {
      lcd.clear();
      ServoOpen();
      lcd.print(" Door is Open ");
      door = true;
      delay(5000);
      loading("Waiting");
      lcd.clear();
      lcd.print(" Time is up! ");
      delay(1000);
      ServoClose();
      door = false;      
    }
    else
    {
      lcd.clear();
      lcd.print(" Wrong Password ");
      door = false;
    }
    delay(1000);
    lcd.clear();
    clearData();
  }

```

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [April 8, 2024, 12:04pm UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/2 "2024-04-08T12:04:40Z")

</div>

Hi @cholland00. All the \>6600 libraries of the Arduino Library Manager are pre-installed in Arduino Cloud. When using Arduino IDE, only a few of the fundamental libraries are pre-installed. You must install any other libraries used by your sketch. When you don't have the library installed, it causes the compilation to fail with a "`No such file or directory`" error.

I'll provide instructions you can follow to install the missing "Keypad" library:

1. Select **Sketch \> Include Library \> Manage Libraries...** from the Arduino IDE menus.  
The " **Library Manager**" dialog will open.

2. Wait for the update to finish, as indicated by the progress bar at the bottom of the " **Library Manager**" dialog.

3. Type `Keypad` in the " **Filter your search...**" field.

4. Press the **Enter** key.

5. Scroll down through the list of libraries until you see the "\*_Keypad by Mark Stanley, Alexander Brevig_" entry. Click on it.  
A menu and button will appear at the bottom of the entry.

6. Click the " **Install**" button in the "" entry.

7. You may now get a dialog asking:

8. Wait for the installation to finish.

9. Click the " **Close**" button in the " **Library Manager**" dialog.  
The " **Library Manager**" dialog will close.

Now try compiling your sketch again. Hopefully this time it will compile without any errors.

---

<div class="post-metadata">

**Author:** ![cholland00](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@cholland00](https://forum.arduino.cc/u/cholland00)\
**Post date:** [April 9, 2024, 10:14am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/3 "2024-04-09T10:14:27Z")

</div>

Thank you so much for your reply.

The problem is now fixed and everything is working.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [April 9, 2024, 10:53am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/4 "2024-04-09T10:53:26Z")

</div>

You are welcome. I'm glad it is working now.

Regards,  
Per

---

<div class="post-metadata">

**Author:** ![blh64](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/blh64/32/605986_2.png) [@blh64](https://forum.arduino.cc/u/blh64)\
**Post date:** [April 9, 2024, 11:55am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/5 "2024-04-09T11:55:05Z")

</div>

So mark post #2 as the solution so everyone knows the problem has been solved.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 6, 2024, 11:55am UTC](https://forum.arduino.cc/t/error-compiling-for-board-arduino-uno/1245248/6 "2024-10-06T11:55:38Z")

</div>

Closed on October 6, 2024, 11:55am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
