How to get data back from arduino?

hello fellow builders and coders,

i'm running some tests with an RFID reader, some tags and a couple of LED's, and I noticed i need the specific ID code from every tag to bind specific commands to the different tags.
so now my question is: how can i relay this data stream back to my laptop? for the code I used:

char val = 0; // variable to store the data from the serial port

void setup() {
Serial.begin(9600); // connect to the serial port
}

void loop () {
// read the serial port

if(Serial.available() > 0) {
val = Serial.read();
Serial.print(val);

}
}

but I have no idea if

  1. it actually works,
  2. I can get these tag ID's visual so i can use em in the "big" project.

Any help is much appreciated, for i can't do that much without those ID codes.

I guess what you wanna do is connecting the RFID reader to two other pins and use SoftwareSerial to read it out. This way you still have the main serial free to communicate with the PC via USB. Your posted code will not work because you are pushing the data from the RFID reader immediately back to it (it probably doesn't know what to do with it).

Hey I just started working on with an RFID reader as well Skyeware M9 and M10. Each RFID reader is going to be quite different in terms of programming it I would suggest reading the spec sheets to see if you can find your solution there usually theres a specific command to read or select each tag. If you are trying to simply send the data from the reader to the computer I would suggesting watching the Jeremy Blum's tutorial on RFID's. Tutorial 12 for Arduino: RFID Card Reading - YouTube

Your options are endless. Ethernet shield, send the data over ethernet, wifi shield, same thing, bluetooth, same thing, use an xbee, use a cheaper radio, use the cellular shield and text it to yourself :). I guess using software serial so you have your USB serial still available is probably the easiest though.