Comments (2)
You're welcome :-) FYI, the enroll
example shows how to use that method, to scan all the flash pages, not just the first page as you're presently doing:
bool get_free_id(int16_t * fid) {
int16_t p = -1;
for (int page = 0; page < (params.capacity / FPM_TEMPLATES_PER_PAGE) + 1; page++) {
p = finger.getFreeIndex(page, fid);
switch (p) {
case FPM_OK:
if (*fid != FPM_NOFREEINDEX) {
Serial.print("Free slot at ID ");
Serial.println(*fid);
return true;
}
break;
case FPM_PACKETRECIEVEERR:
Serial.println("Communication error!");
return false;
case FPM_TIMEOUT:
Serial.println("Timeout!");
return false;
case FPM_READ_ERROR:
Serial.println("Got wrong PID or length!");
return false;
default:
Serial.println("Unknown error!");
return false;
}
yield();
}
Serial.println("No free slots!");
return false;
}
from fpm.
I am using this code in Wemos D1 Mini with R300 Fingerprint Sensor Module.
And this function getFreeIndex
worked for me. It is a clean way to do this task. It saved a lot of my time.
Thanks.
#include <SoftwareSerial.h> // espSoftwareSerial Library V6.8.3
#include <FPM.h>
//Fingerprint Sensor Initilizations
SoftwareSerial fingerprint(D6, D7); // RX, TX
FPM finger(&fingerprint);
FPM_System_Params params;
void setup()
{
Serial.begin(9600);
fingerprint.begin(57600);
if (finger.begin())
{
finger.readParams(¶ms);
Serial.println("Found fingerprint sensor!");
Serial.print("Capacity: "); Serial.println(params.capacity);
Serial.print("Packet length: "); Serial.println(FPM::packet_lengths[params.packet_len]);
Serial.println();
}
else
{
Serial.println("Did not find fingerprint sensor!!! \n");
while (1) yield();
}
get_free_index();
}
//Function to find the very first available index in the Fingerprint Sensor for new fingerprint enrollment
int16_t get_free_index()
{
int16_t index = 0;
uint8_t page = 0;
int16_t x = finger.getFreeIndex(page, &index);
Serial.print("Free index is: ");
Serial.println(index);
return index;
}
from fpm.
Related Issues (20)
- Upload Image To Reader Slot HOT 2
- R503 led_control problem HOT 9
- templates example fails HOT 8
- Getting "packet too long" using the templates example HOT 1
- issue with sunlight HOT 3
- Upload template to AS608 HOT 3
- How can i get buffer data and convert to image? HOT 6
- Template file download time HOT 1
- Upload prints to finger module HOT 6
- Can not connect AS608 to Arduino UNO HOT 2
- Unable to save image using c language HOT 3
- Can we save jpg or png instead of bmp ? HOT 1
- Waiting for valid finger to enroll - finger not detected HOT 1
- Resulting Image HOT 2
- image over udp python example? HOT 7
- Send image over http request HOT 19
- Wrong read length on POST request HOT 1
- Showing error : Communication Error HOT 3
- Error with R307, non-readable char on serial monitor, in arduino web HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpm.