Spread the love

Download the Software

The first thing to do is download the Arduino software.

Go to the Arduino Software Download page and grab the right file for your OS. The packages are quite large, 80-90 MB so it may take a while to finish.

Unpack and Install

Extract the package onto the Desktop.

Startup!.

Double click the Arduino software icon on Desktop.

s1

ide

Connect your Arduino to the USB port of your computer. This may require a specific USB cable. Every Arduino has a different virtual serial-port address, so you ‘ll need to reconfigure the port if you’re using different Arduinos.

ausb

Set the board type and the serial port in the Arduino Programmer.

Select port

Next, its time to configure the Serial Port (also known as the COM Port)

On a PC it will probably be something like COM3 or COM4.

s3

Test the microcontroller by using one of the preloaded programs, called sketches, in the Arduino Programmer. Open one of the example sketches, and press the upload button to load it. The Arduino should begin responding to the program: If you’ve set it to blink an LED light, for example, the light should start blinking.

s2

The “Hello World!” of Physical Computing

The first program every programmer learns consists in writing enough code to make their code show the sentence “Hello World!” on a screen. As a micro controller, Arduino doesn’t have any pre-established output devices. Willing to provide newcomers with some help while debugging programs, we propose the use of one of the board’s pins plugging a LED that we will make blink indicating the right functionality of the program.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.


 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Next Connect a LED to test the Code  – 

led_arduino

We have added a 1K resistor to pin 13, what allows the immediate connection of a LED between that pin and ground. LEDs have polarity, which means they will only light up if you orient the legs properly. The long leg is typically positive, and should connect to pin 13. The short leg connects to GND; the bulb of the LED will also typically have a flat edge on this side

To upload new code to the Arduino, either you’ll need to have access to code you can paste into the programmer, or you’ll have to write it yourself, using the Arduino programming language to create your own sketch. An Arduino sketch usually has five parts: a header describing the sketch and its author; a section defining variables; a setup routine that sets the initial conditions of variables and runs preliminary code; a loop routine, which is where you add the main code that will execute repeatedly until you stop running the sketch; and a section where you can list other functions that activate during the setup and loop routines. All sketches must include the setup and loop routines.

Once you’ve uploaded the new sketch to your Arduino, disconnect it from your computer and integrate it into your project as directed.