I keep trying to import the password.h in to libraries but I never get the option to import sketch to libraries.
Inside IDE select the third possibility next to File Edit Sketch(?). I use Swedish...
Click on "Include library". Then click "Handling libraries" at the top in that new window. Then the installation will be properly made.
Railroader:
Inside IDE select the third possibility next to File Edit Sketch(?). I use Swedish...
Click on "Include library". Then click "Handling libraries" at the top in that new window. Then the installation will be properly made.
I tried but it still did not work. I have the https://playground.arduino.cc/uploads/Code/Password/index.zip downloaded on my laptop but i can't seem to put it in library.
Hmmm. Did You unzip that downloador not? I'm not sure if it's needed or not.
Poke around in that "Handling library" and see if You find something useful. It is possible to incorporate foreign libraries and the new library must get stored an a certain way in order to fit IDE. Maybe I managed that but I don't remember how. Hopefully other helpers step in having more routine in this.
Please provide a detailed description of the problem you're having @Panda18. I'm sure we can help you if you'll only make a better effort to allow us to understand what is happening. Remember, we can't see your computer. All we have to work with are the incredibly vague statements you've made here on the forum.
Arduino: 1.8.11 (Windows Store 1.8.28.0) (Windows 10), Board: "Arduino Uno"
PasswordKeypad:3:10: error: Password.h: No such file or directory
#include <Password.h>
^~~~~~~~~~~~
compilation terminated.
exit status 1
Password.h: No such file or director
here the error message I get
This is the code I'm trying to import in to library for the project I'm doing.https://create.arduino.cc/projecthub/thehack904/motion-sensing-alarm-with-keypad-password-53f05c?f=1 <--- the project
#include <Password.h> //Arduino Playground - HomePage
#include <Keypad.h> //Arduino Playground - HomePage
Password password = Password( "1234" );
const byte ROWS = 4; // Four rows
const byte COLS = 4; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = { 9,8,7,6 };// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = { 5,4,3,2, };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
void loop(){
keypad.getKey();
}
//take care of some special events
void keypadEvent(KeypadEvent eKey){
switch (keypad.getState()){
case PRESSED:
Serial.print("Pressed: ");
Serial.println(eKey);
switch (eKey){
case '*': checkPassword(); break;
case '#': password.reset(); break;
default: password.append(eKey);
}
}
}
void checkPassword(){
if (password.evaluate()){
Serial.println("Success");
//Add code to run if it works
}else{
Serial.println("Wrong");
//add code to run if it did not work
}
}
pert:
Please provide a detailed description of the problem you're having @Panda18. I'm sure we can help you if you'll only make a better effort to allow us to understand what is happening. Remember, we can't see your computer. All we have to work with are the incredibly vague statements you've made here on the forum.
Is it anything else I should add? now that I posted the code I'm working with and why i need it and the error message
You don't "import" code into a library. You install the libraries that your sketch requires.
Do this:
- Download https://playground.arduino.cc/uploads/Code/Password/index.zip
- (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library...
- Select the downloaded file (index.zip).
- Click the "Open" button.
- Delete the downloaded file (index.zip).
- Download Arduino Playground - HomePage
- (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library...
- Select the downloaded file (index.zip).
- Click the "Open" button.
After installing the two library dependencies of your sketch, it will compile without errors.
Panda18:
no longer need help thank for everyone who tried to help mehow do you delete this?
What you have done is considered to be thread vandalism and is very much frowned on - it is not in the Open Source spirit.
The best way to say "thank you" is to make your information available for other Forum readers.
That means that your Thread won't be deleted and you should do your part by reinstating your Original Post and your original Title.
Without the text from your Original Post people reading this Thread can't make sense of the Replies.
...R
Vandalism reverted.
@Panda18, please don't do that. Repeated vandalism will result in a suspension from the forum.
Thanks in advance for your cooperation.