Getting the Feedback in Serial Monitor

Just yesterday I had my first experience and success with the Arduino and a stepper motor. I want feed back from the Arduino so I can see what my variables are at at given intervals of time. I am connected to the Arduino using the USB cable. I am guessing that I don't need to mess with any of the pins and the information is in the micro controller, yes? I looked over the http://arduino.cc/en/Reference/Serial section but I am unsure as to the process of getting information back and printed. Are the steps

  1. open a serial port
  2. read specific information
  3. print result?

If I have a variable "unsigned long stepCount = 3400;. How do I read that from the board and display it on the Serial Monitor?

Thanks

You pretty much have it. You begin with Serial.begin(9600);

Then, you simply use Serial.println(yourVariable); to print it.

Simple :)

Then, you simply use

In my humble opinion, you should use:

Serial.print("The whatever value is: ");
Serial.println(yourVariable);

Otherwise, a stream of numbers on the Serial Monitor can be next to impossible to decipher.

Great! so I don't need to mess with any of the pins on the Arduino board. Everything is handled through the USB cable?

Great! so I don't need to mess with any of the pins on the Arduino board. Everything is handled through the USB cable?

Just try it. You'll like it.