1 that appears when the processing code is run and then 3 others that come when the specific RFID tag is placed on the reader.
What I need some help with is that once a tag is placed on the reader. I want the reader to keep reading the tag, then once the tag has been taken off to go back to the startup image which in my code is called 'stack'.
Here is my code:
import processing.serial.*;
Serial myPort;
String inString;
String RFID1 = "67005DB143C8"; //Card 1 RFID
String RFID2 = "67005DC651AD"; //Card 2 RFID
String RFID3 = "2500AC086AEB"; //Card 3 RFID
PImage jpg;
boolean sketchFullScreen() {
return true;
}
void setup() {
size(1280, 800);
myPort = new Serial(this, Serial.list()[5], 9600);
myPort.bufferUntil('\n');
jpg = loadImage("stack.jpg");
if (frame != null) {
frame.setResizable(true);
}
}
void draw() {
background(255);
image(jpg, width/1500, height/900);
if(inString != null){
fill(150,255);
}
}
void serialEvent (Serial myPort) {
inString = myPort.readStringUntil('\n');
if (inString != null) {
inString = trim(inString); // trim off any whitespace:
print("RFID = " + inString + " : ");
if (RFID1.equals(inString) == true){ //checks inString to see if it matches the first RFID
println("Card 1");
jpg = loadImage("card1.jpg");
}
if (RFID2.equals(inString) == true){ //checks inString to see if it matches the first RFID
println("Card 2");
jpg = loadImage("card2.jpg");
}
if (RFID3.equals(inString) == true){ //checks inString to see if it matches the first RFID
println("Card 3");
jpg = loadImage("card3.jpg");
}
}
}
Does any of you kind people know how I would go about doing this please?
I am having trouble getting a video to play once a RFID tag is placed on the reader.
I have looked at the references on this site and tried google but I can't anything about getting videos to play.
I have been able to get it to work with images, but I don't know how to get a video to pop up and play once a RFID tag is placed. Could anyone help please?
Here is the code I have got for getting images up with RFID:
import processing.serial.*;
Serial myPort;
String inString;
String RFID1 = "67005DB143C8"; //Card 1 RFID
String RFID2 = "67005DC651AD"; //Card 2 RFID
String RFID3 = "2500AC086AEB"; //Card 3 RFID
PImage jpg;
boolean sketchFullScreen() {
return true;
}
void setup()
{
size(1280, 1024);
myPort = new Serial(this, Serial.list()[5], 9600);
myPort.bufferUntil('\n');
jpg = loadImage("scan.jpg");
imageMode(CENTER);
if (frame != null) {
frame.setResizable(true);
}
}
void draw()
{
background(255);
image(jpg, width/2, height/2);
if(inString != null){
fill(150,255);
}
}
void serialEvent (Serial myPort) {
inString = myPort.readStringUntil('\n');
if (inString != null) {
inString = trim(inString); // trim off any whitespace:
print("RFID = " + inString + " : ");
if (RFID1.equals(inString) == true){ //checks inString to see if it matches the first RFID
println("Card 1");
jpg = loadImage("card1.jpg");
}
if (RFID2.equals(inString) == true){ //checks inString to see if it matches the first RFID
println("Card 2");
jpg = loadImage("card2.jpg");
}
if (RFID3.equals(inString) == true){ //checks inString to see if it matches the first RFID