Safe with LCD ;2 MICRO SERVOS; MICROSWITCH;2LEDS;FINGERPRINT

Okay Guys i need help with a code for my project i have and lcd,and servo that works,now the 2leds,microswitch and fingerprint i cant get to work.

i need help i do not understand very much of programming im trying to learn a bit by bit,and sorry for my english.

here is my code this code works with lcd and 2micro servos now i need is microswitch to work with the 2 leds when it detects the door and fingerprint this is all i need. Ty

#include <Servo.h>;

const int servoPin1 = 13;
const int servoPin2 = 12;
Servo servo1;
Servo servo2;
int counter = 0;


#include <Keypad.h>

const byte numRows = 4; //number of rows on the keypad
const byte numCols = 4; //number of columns on the keypad

int PIN_CODE[4] = {2, 5, 8, 0};
int PIN_INTRO[4];
int flag = 0;
int ERRO = 0;


/*keymap defines the key pressed according to the row and columns just as appears on the keypad*/
char keymap[numRows][numCols] =
{
 {'1', '2', '3', 'A'},
 {'4', '5', '6', 'B'},
 {'7', '8', '9', 'C'},
 {'*', '0', '#', 'D'}
};

//Code that shows the the keypad connections to the arduino terminals
byte rowPins[numRows] = {11, 10, 9, 8}; //Rows 0 to 3
byte colPins[numCols] = {7, 6, 5, 4}; //Columns 0 to 3

//initializes an instance of the Keypad class
Keypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);


#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Inicializa o display no endereco 0x27
LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);




void setup()
{
 Serial.begin(9600);
 PIN_CODE[0] = '2';
 PIN_CODE[1] = '5';
 PIN_CODE[2] = '8';
 PIN_CODE[3] = '0';
 lcd.begin (16, 2);
 lcd.setBacklight(HIGH);
 lcd.setCursor(0, 0);
 lcd.print("Arduino 12TGEI");
 lcd.setCursor(0, 1);
 lcd.print("LCD e modulo I2C");
 pinMode( 2 , INPUT );








servo1.attach (servoPin1);
servo2.attach (servoPin2);

servo1.write (80);
servo2.write (150);
}





//If key is pressed, this key is stored in keypressed variable
//If key is not equal to NO_KEY, then this key is printed out
//if count=17, then count is reset back to 0 (this means no key is pressed during the whole keypad scan process
void loop()
{
 int keypressed = myKeypad.getKey();
 if (keypressed != NO_KEY)
 {
   Serial.println(keypressed);
   Serial.println(flag);



   if (flag < 4) {

     if (flag == 0) {
       lcd.setCursor(0, 0);
       lcd.print(" INTRODUZIR PIN ");

       lcd.setCursor(0, 1);
       lcd.print("                 ");
       lcd.setCursor(1, 1);


     }
     lcd.print("  *");
     PIN_INTRO[flag] = keypressed;
     Serial.print("flag = ");
     Serial.println(flag);
     Serial.print("PIN_INTRO["); Serial.print(flag); Serial.print("]="); Serial.println(PIN_INTRO[flag]);
     Serial.print("PIN_CODE["); Serial.print(flag); Serial.print("]="); Serial.println(PIN_CODE[flag]);
     flag++;


   }

   if (flag == 4) {

     valida();
     flag = 0;
   }


 }
 
}

void valida()
{

 ERRO = 0;
 for (int i = 0; i < 4; i++) {
   if (PIN_INTRO != PIN_CODE) {
     Serial.print("PIN_INTRO["); Serial.print(i); Serial.print("]="); Serial.println(PIN_INTRO);
     Serial.print("PIN_CODE["); Serial.print(i); Serial.print("]="); Serial.println(PIN_CODE);
     ERRO++;
   }
 }
 Serial.print("ERRO = ");
 Serial.println(ERRO);

 if (ERRO == 0) {
   lcd.setCursor(0, 0);
   lcd.print("   PIN CORRETO ");

   lcd.setCursor(0, 1);
   lcd.print("   ABRIR PORTA  ");

   servo1.write (80);
   servo2.write (150);

   delay(2000);
   lcd.setCursor(0, 0);
   lcd.print(" INTRODUZIR PIN ");

   lcd.setCursor(0, 1);
   lcd.print("                ");

 } else {

   lcd.setCursor(0, 0);
   lcd.print("   PIN ERRADO  ");

   lcd.setCursor(0, 1);
   lcd.print("                ");
   servo1.write (150);
   servo2.write (75);

   delay(2000);
   lcd.setCursor(0, 0);
   lcd.print(" INTRODUZIR PIN ");

   lcd.setCursor(0, 1);
   lcd.print("                ");

 }


 flag = 0;
}
 pinMode( 2 , INPUT );

How IS the switch wired to this pin? INPUT_PULLUP would make for much simpler wiring - connect one leg to the pin, connect the other leg to ground.

Where do you read the state of this pin?

What presses/releases the switch connected to this pin?

What fingerprint scanner do you have? How is it connected? Where is the code to read a fingerprint?

PaulS:

 pinMode( 2 , INPUT );

How IS the switch wired to this pin? INPUT_PULLUP would make for much simpler wiring - connect one leg to the pin, connect the other leg to ground.

Where do you read the state of this pin?

What presses/releases the switch connected to this pin?

What fingerprint scanner do you have? How is it connected? Where is the code to read a fingerprint?

This code neither microswitch neither leds or fingerprint is connected to the code ;what i need help for is to put in the code all connected.

I have this sensor fingerprint

the microswith is pressed with a a screw when the door is closed.