Sometimes you really need to use the Serial port (UART or USART) of Arduino to communicate with your computer (or other devices) for debugging or readings.
Arduino uses digital pins 0 (RX, receive) and 1 (TX, transmission) for Serial communication with all devices and the USB cable for communication with the computer (and the built-in Serial Monitor from the Arduino IDE).
The code for doing this is pretty simple, you just need to initialize the serial port and set the baud rate (symbols per second) like this : Serial.begin(9600); and then receive/transmit using the next functions : print, println and write. For official documentation on this click here.
As an example .. I wrote 2 small programs that does this :
- the first one : uses the Hello World! from the previous post and it outputs to the Serial Monitor the current status of the LED using print and println functions.
- the second one : is fully based on the first example but it also receives data from the computer to turn on/off the LED using the read function.
You can see their code on Tutorialpedia.
To start the Serial Monitor from Arduino IDE .. just click the last button from the option’s bar and set the baud rate to match your own baud rate used while initializing with Serial.begin(). After pressing the Serial Monitor button a new black area will appear where you can send data to your Arduino board or see the output of it.

Serial Monitor from Arduino's IDE
Posted in Arduino.
By Trimbitas Sorin
– August 17, 2009
As in all programming languages .. you start with a Hello World! code so you can see the basic structure for that language.
Because Arduino can’t just print ‘Hello World!’ (in fact it can but using an external device, like an LCD display, which I will describe in another tutorial) the easiest way is to blink a LED.
To do this, open the Arduino IDE and copy & paste the code I posted on tutorialpedia.org.
What it does is this : set a state switch than toggle between on and off after a delay of 1 second.

Arduino IDE
To verify a code on the Arduino IDE click the button marked with (1) and to upload it into the chip click the (2) button.
The electronic part is really simple too .. take a LED, and connect its anode (+) to pin 13 and it’s catode (-) to ground (GND).
Upload the program into the chip and then you’ll see the LED blinking

arduino hello world
That was all
Posted in Arduino.
By Trimbitas Sorin
– August 9, 2009
Ok, I got more free time so I dedicated it to few Arduino tutorials starting from the simplest one : Hello World! – blinking a LED and culminating with the build of my own Arduino-based robot.
The plan is to learn you (and myself) the basics of connecting Arduino to LEDs, temperature sensors, distance sensors, DC and servo motors and finally combining all this into a nice & simple robot
All the code for driving the components will be written on the newly launched tutorialpedia.org, a nice service that enables coders to work on a collaborative knowledge base that anyone can improve. You should also give it a try when you have some spare time.
Posted in Arduino.
By Trimbitas Sorin
– August 8, 2009
Latest Comments