RFID 125kz : Capturing and storing value in a variable

Hello

I' go a small RFID module similar to this one below. A small code to capture the RFID value
Good value captured: <2400DBBEB6F7>

Problem is I can't capture the value ans store it in a variable.

I did try some other code but no succees yet.

Any help appreciated
Martin

The small code to read and print the value

#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);

void setup()
{
 mySerial.begin(9600); // Setting the baud rate of Software Serial Library  
 Serial.begin(9600);  //Setting the baud rate of Serial Monitor 

}
void loop()
{ 
 if(mySerial.available()>0)
 {
  Serial.write(mySerial.read());
 }
}

What do you intend to do with the variable?

pert:
What do you intend to do with the variable?

Sorry for the late reply, the mail was in the junk basket.

I want to use the variable has a reference for a define product in a cylinder

Tag decoded variable will be use in a report.

Martin

Good value captured: <2400DBBEB6F7>
Problem is I can't capture the value ans store it in a variable.

Spend a little time with Robin2's Serial Input Basics tutorial. You will find the answer there.

The easiest solution is to use mySerial.readBytes() or mySerial.readBytesUntil():

The only problem with that solution is that, unlike your current code, it will block the execution of the rest of your code until the full communication has been received from the RFID module (or the function times out). The time to receive the data is a matter of milliseconds, but in some cases that can be an unacceptably long time to block the code. In this case, you would want to keep your loop() function running and save data to the global buffer variable when it's available.

Thanks for you input, I will look at it.

This a great and respectful community. I'm learning with greater steps than if I was alone.

Martin.