Arduino: quirks and pitfalls

In this post I will list all pitfalls I encountered while experimenting with Arduino boards. Some of these topics may seem logical to the more advanced Arduino developer, however, as a novice, not knowing them may cause a lot frustration.

Obviously this list is a work-in-progress.

Serial connection

Digital pins marked with RX or TX (usually pin numbers 0 and 1) cannot be used when a serial connection is set up in your sketch. So whenever your setup function contains Serial.begin(9600), driving e.g. a LED using the pins marked RX or TX will not be possible.

Also: when pins 0 or 1 are connected to the ground (e.g. with a LED and a resistor in between), uploading a sketch could result in an error being thrown. I suspect this is due to a disturbance serial signal.

Sketch upload error (timeout)

This might be an Arduino Mega only issue.

Before uploading a sketch to your board, make sure the 5V connection is not connected. If it is, you might not be able to upload you sketch and the Arduino console might output something like:

timeout communicating with programmer