Moderators: adafruit_support_bill, adafruit
// Write the first two bytes:
Serial.write(0xef);
Serial.write(0x01);#include <SoftwareSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>
SoftwareSerial FPM10A(2,3); //Create a 'fake' serial port. Pin 2 is the Rx verde pin, pin 3 is the Tx bianco pin.
/*----------external commands----------*/
char receive_command[20]={};
char VfyPwd[10]="VfyPwd "; //Verify password
char GenImg[10]="GenImg "; //Record fingerprint image
char UpImg[10]="UpImg "; //Upload image
char DownImg[10]="DownImg "; //Download image
char Img1Tz[10]="Img1Tz "; //Geneated features saved to CharBuffer1
char Img2Tz[10]="Img2Tz "; //Generated features saved to CharBuffer2
char RegMode1[10]="RegMode1 "; //Template of geature combiation
char UpChar[10]="UpChar "; //Upload featues or template
char DownChar[10]="DownChar "; //Download features or template
char Store[10]="Store "; //store template
char LoadChar[10]="LoadChar "; //Read template
char DeletChar[11]="DeletChar "; //delete template
char Empty[10]="Empty "; //clean out fingerprint library
char cnt;
unsigned int Templete_Num;
unsigned int ACK_Sum;
volatile unsigned char UART1_FINGERPRINT_RECEVICE_BUFFER[24];
unsigned char receive_ACK[24];
/*----------FINGERPRINT protocol definition -----------*/
unsigned char FP_Delet_All_Model[6]={0x01,0x0,0x03,0x0d,0x00,0x11};
//delete specified template
/*----------inilization-----------*/
void setup()
{
Serial.begin(9600); // open serial port, and set the baud rate to 9600 bps
FPM10A.begin(57600);
}
/*----------main loop-----------*/
void loop()
{
Empty_Finger();
}
void FINGERPRINT_Cmd_Delete_All_Model(void)
{
unsigned char b;
for(b=0;b<6;b++)
FPM10A.write(FP_Pack_Head[b]);
for(b=0;b<6;b++)
FPM10A.write(FP_Delet_All_Model[b]);
}
void Empty_Finger(void)
{
FINGERPRINT_Cmd_Delete_All_Model();
for(unsigned char b=0;b<12;b++)
{
receive_ACK[b]= FPM10A.read();
}
if(receive_ACK[9]==0x00)
{
Serial.println("Empty_OK");
}
else
{
Serial.println("Empty_ERROReee");
Serial.println(receive_ACK[9]);
}
delay(1000);
}Return to Other Arduino products from Adafruit
Users browsing this forum: No registered users and 3 guests