Do you understand this comment at the beginning of the code
// [color=red]Software serial for when you dont have a hardware serial port[/color]
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
// On Leonardo/Micro/Yun, use pins 8 & 9. [color=red]On Mega, just grab a hardware serialport[/color]
[color=red]SoftwareSerial mySerial(10, 11);[/color]
They also sent say
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
//Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1);
How is your sensor connected?