Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- #include "FPS_GT511C3.h"
- #include "SoftwareSerial.h"
- Servo servo1;
- Servo servo2;// create servo objects to control a servo
- FPS_GT511C3 fps(3, 4);
- int pos1;
- int pos2; // variables to store the servo position
- int vfr = 0;
- void setup() {
- servo1.attach(5);
- servo2.attach(6);// attaches the servo on pin 9 to the servo object
- Serial.begin(9600); //set up Arduino's hardware serial UART
- delay(100);
- fps.Open(); //send serial command to initialize fps
- fps.SetLED(true); //turn on LED so fps can see fingerprint
- }
- void loop()
- {
- // Identify fingerprint test
- if (fps.IsPressFinger())
- {
- fps.CaptureFinger(false);
- int id = fps.Identify1_N();
- if (x < 2)
- {
- for (int i=0; i<90; i += 1) {
- pos1 = 180 - i; // servo1 from 90 to 45 degrees
- pos2 = 0 + (2*i); // servo2 from 0 to 90 degrees
- servo2.write(pos1);
- servo1.write(pos2);
- delay(50);
- }
- ++x;
- }
- }
- else
- {//if unable to recognize fingerprint
- Serial.println("Finger not found");
- }
- }
- else
- {
- Serial.println("Please press finger");
- }
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement