Output?

Hi, brand new at arduino - got a micro and a gyroscope... found a sketch to get the gyro output - but wondering where do I see any output from the sketch? In the loop method I see: Serial.print("X:"); Serial.print(x); Is that the serial monitor? My micro is on com 5 - which is what serial monitor is showing, but I see nothing... is the sketch not working or? I'm not sure how I tell.

ALso, I have this in setup():

Serial.begin(9600);

Serial.println("starting up L3G4200D");

SHouldn't I at least see the starting up message in the serial monitor? I don't...

You should see that if your'e not too late to catch it. That message will appear quite soon after starting your Arduino. So do you have your serial monitor running when booting up your Arduino ? And ofcourse have it at 9600 baud.

Some more tips: Look in the Examples folder and find another serial sketch. Try that one with serail monitor. Change your sketch to send more serial data so you can see what's going on. Have a puse after every line in your sketch during this. Great for debugging. But you'd need to have serial monitor and data sent from Arduino under control.

An Arduino Micro is like an Arduino Leonardo. The serial port is used in a different way.

Add this code after Serial.begin(9600);

// wait for serial port to connect. Needed for Leonardo only
while (!Serial) { ; }

You upload the code, after that the sketch starts running. The sketch will stop at that line. If you open the serial monitor, the sketch will continue.

Hmmmm erdin, I see that !serial thing is only "needed" for Leo, but can it be used on others- I have a Uno? For reasons known only to Messrs Hewlett, Packard and Gates my serial monitor takes ages to open, so that would be handy for me.

I suppose rather than ask I should just try it eh? 8)

Edit.... nope, doesn't work for Uno. I put that line into the setup() of normal blink program, but it ran over it and started blinking in loop() immediately. Pity, that.

How to use this forum

Post all your code, please.

For other (normal) Arduino boards, that code will not stop the sketch. It is ment to do that, since the serial output of the Arduino Uno is no problem. If a serial monitor is opened during the sketch in the Uno, the messages are shown without problem.

Do you have a Java problem with the serial port ? You can remove Java from your computer, download the newest Arduino 1.0.4 or 1.5.2 and use that. The Arduino software includes a subset of Java.

Do you have a Java problem with the serial port ? You can remove Java from your computer, download the newest Arduino 1.0.4 or 1.5.2 and use that. The Arduino software includes a subset of Java.

My whole Arduino thing is very very slow.... opening the IDE takes ages... on my daughter's laptop it's open in the blink of an eye, as is the monitor when clicked. It's always been like that... I started with 1.0 and have 1.0.1 right now. Maybe I should upgrade, via a Java removal... I'll try that.

OK, I can see the output now. Seems the getGyroValues() method is the problem. Even calling a single line like so:

byte xMSB = readRegister(L3G4200D_Address, 0x29);

causes a problem, and no output. The address variable is defined at the top like so:

int L3G4200D_Address = 105; //I2C address of the L3G4200D

Please re-read reply #5