We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import processing.serial.*;
import java.util.Date;
int inByte;
int col = 50 ;
PImage img1;
int curr, prevSec;
int offset;
Serial myPort;
PrintWriter output, input;
BufferedReader reader;
String[] line;
int prev = 0;
int oldInByte=0;
int offSet=0;
String _day, _month, _year, _hour, _minute, _second;
String _path =".txt";
String s1;
String[] userNames;
int index=0;
String[][] lists ;
void setup()
{
size(800, 400);
background(255, 255, 0);
textSize(32);
//input = createWriter("ReadUserID.txt");
int var=1;
_day = str(day());
_month = String.valueOf(month());
_year = String.valueOf(year());
_hour = str(hour());
_minute = str(minute());
_second = str(second());
// s1 = _year+'/'+_month+'/'+_day+'/'+_month+_year+_path;
s1 =_year+"year"+'/'+_month+"month"+'/'+_day+"day"+'/'+_hour+'.'+_minute+_path;
output = createWriter(s1);
output.println(" txt file generated by fingerPrintExporter - v.2.0");
output.println("");
output.println("#####################################################");
output.println(";Date/Time:"+month()+'/'+day()+'/'+year()+"\t"+ hour()+':'+minute()+':'+second());
output.println("#####################################################");
reader = createReader("ReadUserId.txt");
// String lastModified = new Date(f.lastModified()).toString();
// frameRate(12);
img1 = loadImage("500px-Print_Sensor.jpg");
// create a font with the third font available to the system:
PFont myFont = createFont(PFont.list()[9], 30);
textFont(myFont);
printArray(Serial.list());
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
// noLoop();
userNames = loadStrings("ReadUserId.txt");
}
int cntr;
void draw()
{
background(#ffffff);
image(img1, 500, 0);
text("Finger Print Id Detector /2014", 5, 20);
text(millis()/60000+" min", col, 75);
if (inByte==255 ) {
text("Recieved data: < >\n", col, 100);
text("< Place your Finger !...>", 500, 200);
} else text("Recieved data:< "+inByte+" >", col, 100);
fill(#000000);
if (inByte==255 || inByte==0)text("reading new id ", col, 200);
else text("ID "+inByte+" belong to : .. ", col, 200);
text("Date:"+day()+"/"+month()+"/"+year()+" \t"+"Time:"+hour()+":"+minute()+":"+second(), 500, 250);
// text("Time:"+hour()+":"+minute()+":"+second(),col,150);
s1 = "name:";
// output.println(s1);
if (prev>254)prev=254;
if (prev<=0)prev = 0;
text("Last."+userNames[prev], col, 300);
output.flush();
}
void serialEvent(Serial myPort)
{
inByte = myPort.read();
if (inByte>0 && inByte<255)prev = inByte;
if (prev!=curr) {
curr = prev;
output.println("-------------------------------------------");
output.println( "\t"+hour()+":"+minute()+":"+second()+"\t "+userNames[prev-1]);
}
}
void keyPressed() {
output.flush(); // Writes the remaining data to the file
output.close(); // Finishes the file
exit(); // Stops the program
}
Comments
// arduino code #include <EEPROM.h>
hi to all