Necessary changes to master library - gsreeves/Fingerprint_Scanner-TTL GitHub Wiki

The master library uses the SoftwareSerial library to create an object called _serial to handle communications with the fingerprint scanner. We want to use unused UART serial ports on Mega or Leonardo instead, since they are more reliable and since this will release resources like timers for other uses.

To do

Replace _serial object with Serial1 object for Leo or Serial1/2/3 object with Mega.

Remove features of SoftwareSerial not available in Serial1 class. For example, listening happens differently.

Remove initialization ": _serial(rx, tx)" in constructor.

Allow construction of an object with no parameters, since Serial1 pins are fixed on Leo. On Mega default will be Serial1.

Allow construction of an object with single parameter to control which Mega port to use.

Change examples to work with changes above.

Add a Serial1.begin(9600) to the setup function, if not already in constructor.

Check that baud-rate changes work, taking Serial1 offline and back on with new baud.