Other Things to Do

We sent the character to control the LEDs separately, by clicking send after each character. However, it will work just as well, if you send all the character commands in a single line. Try entering the following into the Serial Monitor and clicking 'Send':


Now, lets see just how fast our Arduino can communicate. Change the baud rate in the sketch from 9600 to 115200 and upload it to the board again. Then after opening the Serial Monitor select 115200 from the drop-down list.
You should find that that everything still works. High speed communication not often necessary, so the baud rate of 9600 is often used, as many serial peripherals such as GPS modules will have this as a default baud rate, so it is something of a standard.

Also, try mismatching the baud rate - use Serial.begin(9600) and select 57600 in the dropdown menu, for example. See what it looks like? All garbled? That's a mismatch. If you're ever getting strange data in the Serial monitor, triple check your baud rates and make sure they match!

The Serial Monitor is also a great way of debugging a sketch that is misbehaving. Sometimes,  when a sketch is not behaving how you think it should behave, placing Serial.println() statements in key places will help you see what is going on.
About the Author

Simon Monk is author of a number of books relating to Open Source Hardware. The following books written by Simon are available from Adafruit: Programming Arduino30 Arduino Projects for the Evil Genius and Programming the Raspberry Pi.
Last updated on 2015-05-04 at 04.27.11 PM Published on 2012-12-04 at 10.52.56 AM