guys i have done this programing after a lot of trial but now it is showing that Error problem loading to the bord aurduino /genuino uno . So, guys if any of you plzz tell me the solution then it would help me a lot . its urgent plzz reply soon
#include <U8glib.h>
#include <Password.h>
#include <Keypad.h>
int LED = 1 ;
Password password= Password("1937");
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] = {3, 2, A1, A2};
byte colPins[COLS] = { 7, 6, 5, 4};
Keypad keypad = Keypad ( makeKeymap(keys), rowPins,colPins,ROWS,COLS);
void setup() {
Serial.begin(96000);
keypad.addEventListener ( keypadEvent );
}
void loop() {
keypad.getKey();
// put your main code here, to run repeatedly:
}
void keypadEvent (KeypadEvent eKey){
switch (keypad.getState()){
case PRESSED:
switch (eKey) {
case '*': checkPassword();break;
case '#': password.reset(); LED.LOW; break;
default: password.append(eKey);
}
}
}
void checkPassword(){
if (password.evaluate() ) {
LED.HIGH;
} else {
LED.LOW;
}
}
error result - Arduino: 1.8.7 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino:6:35: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
Password password= Password("1937");
^
In file included from sketch\sketch_oct05b.ino.cpp:1:0:
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino: In function 'void keypadEvent(KeypadEvent)':
C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:41:14: error: expected unqualified-id before numeric constant
#define LOW 0x0
^
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino:33:39: note: in expansion of macro 'LOW'
case '#': password.reset(); LED.LOW; break;
^
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino: In function 'void checkPassword()':
C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant
#define HIGH 0x1
^
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino:41:9: note: in expansion of macro 'HIGH'
LED.HIGH;
^
C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:41:14: error: expected unqualified-id before numeric constant
#define LOW 0x0
^
C:\Users\INTEL\Documents\Arduino\sketch_oct05b\sketch_oct05b.ino:43:9: note: in expansion of macro 'LOW'
LED.LOW;
^
Multiple libraries were found for "Password.h"
Used: C:\Users\INTEL\Documents\Arduino\libraries\Password
Not used: C:\Users\INTEL\Documents\Arduino\libraries\Desktop
exit status 1
Error compiling for board Arduino/Genuino Uno.