Ok, let’s get started with Arduino. You’ve decided that you want to learn some electronics and don’t have any clue on where to start. I was exactly in the same situation a while ago. I had bought the “electronics for dummies” book, red some paragraphs of it about resistors and some other components, but I had no idea on how to connect them and make them do things I need. The arduino is exactly what a beginner needs - it has very simple programming language, it can be connected directly to your computer via USB cable.

The first step obviously is getting a arduino board. The interesting thing is you can choose - you can build your own board or buy a ready made. I don’t think it’s wise for beginners to build the board themselves. As I live in Latvia, where there are no arduino board resellers, I chose to order one from CoolComponents. It cost me a total of GBP 25, which is quite few if we compare to other development board programmers and software packages needed. The best part is that the arduino development environment (the code editor) is free.

Ok, we’ve got the programming board, what next? I need to connect it to my computer and get some electronic components to do the testing of the board. You can buy a USB cable, but I chose to use one from my printer. As about the components, I had no clue about what I need, so I took a look at the arduino website getting started guide and saw that the only thing you need to get started with programming is a single diode, which you can get for a dime in the local electronics store.

Despite the fact that arduino website tells you that you need to install drivers for Windows, my Windows XP Pro downloaded all the drivers for arduino automatically right after connecting it to my PC. If you use other operating system, probably you’ll need to follow the guide in the arduino website.

So far so good, I decided I’m ready for the first tutorial from the arduino website. The tutorial shows you how to blink a LED. Nothing special, but quite useful for beginners. I put the LED in the digital output 13 and GND in the arduino board and just did a copy and paste from the tutorial page. The first upload to the arduino board .. and a couple of seconds later my circuit is running! The LED is blinking. WOW!

int ledPin = 13; // LED connected to digital pin 13

void setup()
{
	pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop()
{
	digitalWrite(ledPin, HIGH);   // sets the LED on
	delay(1000);                  // waits for a second
	digitalWrite(ledPin, LOW);    // sets the LED off
	delay(1000);                  // waits for a second
}

Basically this is a very simple program. Each of the arduino programs consist of two parts. The setup and loop functions. The setup function is executed once upon the startup of the circuit, while the loop function is executed over and over while the circuit is running. Before the setup function we can define some variables. In this case we define the ledPin variable which will contain the number of pin we use for the LED. As we can see the setup function just defines that the 13th pin will be used for output. The loop function ouputs the current to 13th pin, then waits for 1000ms (which is 1 second) and then turns off the current and waits for another 1000ms. After the delay of 1000ms averything starts from the beginning - the led is turned on again. You can play around with the delay values and re-upload the program to the board. The satisfaction is guaranteed.

If you have done any C/C++ or PHP programming, the syntax should be straightforward to you. As I’ve been doing PHP programming for some 5 years now and I have some basic C/C++ and other programming language background I didn’t have any problems with this.

Ok, that’s for the very basics, get ready for the next things!