Fingerprint sensor operated SERVO MOTOR

hello guys,

i am making bio metric door lock for my home. i am using fingerprint(adafruit R307) sensor and sg90 servo moto.

WHAT I WANT TO DO- when i put my finger to sensor, motor should go to 0 to 90 degree and again i put my same finger to sensor it should go to 90 to 0 degree.

PROBLEM- myservo motor work like sweep and some time it stop at 90 degree.

the problem might be in your code

i am using this code.

{ {do{myservo.write(20);
if(pos=0)
break;}
while(FINGERPRINT_OK);
}

Serial.println( myservo.read());}

{ {do{myservo.write(0);
if(pos=20)
break;}
while(FINGERPRINT_OK);
}}

The WHOLE sketch may be better but before you post it please take a little time with the two links below.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

I found this link:

there is also a video there with some instructions.

Also there are some examples after you install the library.
I also found examples on GitHub:

I've never worked with the sensor, but I would start from there.

Hope it helps.

@vishwam_17

I warned you about duplicate posts Please take the next 7 days to read the links I provided earlier !