#include <Keypad.h>
#define LED 13
#define LED 12;
int buzzer = 9;
const byte ROWS = 4; //quattro righe
const byte COLS = 3; //tre colonne
char keyInsert[6];
int i = 0;
int j = 0;
int s = 0;
int x = 0;
char code[7]= "112233";
}
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'},
};
}
byte rowPins[ROWS] = {8,7,6,5};
byte colPins[COLS] = {4,3,2};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
}
void setup(){
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(buzzer, OUTPUT);
const int buttonPin = 1;
int buttonState = 0;
}
}
void loop(){
char key = keypad.getKey();
if (i==0);
Serial.println("Insert PIN to verify...");
i++;
}
}
if (key != NO_KEY && j<6){
Serial.print("*");
keyInsert[j]=key;
j++;
}
}
if(key == '*') {
Serial.println();
Serial.println("Verifyng the code...");
delay(100);
for(s=0; s<6;s++);
if(keyInsert[s]==code[s]);
x++;
}
}
if(x==6){
Serial.println("The code is correct");
digitalWrite(13,HIGH);
digitalWrite(9,HIGH);
delay(20);
digitalWrite(9,LOW);
delay(200);
}
digitalWrite(13,LOW);
}
}
else{
Serial.println("The code is incorrect, please retry");
digitalWrite(12,HIGH);
delay(200);
x=0;
i=0;
j=0;
digitalWrite(12,LOW);
}
}
if(key == '#'){
x=0;
i=0;
j=0;
}
}
Arduino:1.6.1 (Windows 8.1), Scheda:"Arduino Uno"
Serratura.ino:14:1: error: expected declaration before '}' token
Errore durante la compilazione
what am I doing wrong?