I have a simple python code that read RFID card that run as a loop and whenever I put a card - I can see it's data. I want to run the code in a loop - and when I get new data(new card) I will see it in my java application.
something like this :
12:13:10
12:13:20
12:13:30
12:13:40 - Card Found , Data is - "David Card"
12:13:50
12:14:00 - Card Found , Data is - "kate Card"
can someone help? or maybe start show me how to ?I'm new at java
the python file is Read.py and it's from here
https://pimylifeup.com/raspberry-pi-rfid-rc522
Thanks ,
this is the Java code for show that print time every 10 seconds
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Show_Time
{
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
public static void main(String[] args)
{
while (true)
{
try{
Date date = new Date();
System.out.println(new Timestamp(date.getTime()));
Thread.sleep(10000);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
finally {}
}
}
}