adafruit / Adafruit-Fingerprint-Sensor-Library

Arduino library for interfacing to the fingerprint sensor in the Adafruit shop
http://www.adafruit.com/products/751
Other
417 stars 340 forks source link

New serial begin method for ESP32 to allow the user to specify the cor… #113

Closed NicoBocki closed 2 years ago

NicoBocki commented 2 years ago

New serial begin method for ESP32, that allows to specify custom RX TX pins. As any pin can be used for this.

grafik

ladyada commented 2 years ago

we prefer not to have specialized functions for chips - its hard to maintain. what if you set up the Serial object pins then pass it in as a HardwareSerial reference?

NicoBocki commented 2 years ago

@ladyada

Hello i can not set the pins before serial begin is executed:

https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/HardwareSerial.h https://github.com/espressif/arduino-esp32/pull/7040

In my opinion it is not convenient to set the pins after calling the library method to start communication.

finger.begin(57600); Serial2.setPins(9, 10);

When a new sample application is provided, for the esp32 it will be ok. For beginners it is not so nice to use the UART

ladyada commented 2 years ago

OK but without the changes to the library, does this initialization work?

finger = Adafruit_Fingerprint(&Serial2);
finger.begin(57600);
Serial2.setPins(9, 10);
ladyada commented 2 years ago

no response