A few basics for using the Arduino Platform

Arduino is one of the most popular hobby and prototype platforms. This article will go over some basics about the Arduino Hardware and software.

What is an Arduino? - learn.sparkfun.com
A standard arduino UNO

Above is a standard Arduino UNO board. Since it is one of the most commonly used Arduino Boards, we will use it as reference in this article. Arduino boards come in all shapes, sizes and capabilites from the tiny Arduino Nano, to the huge Arduino Mega, to the Arduino 101 being the first Arduino to feature an intel processor and has native bluetooth functionality.

Hardware Section:

Above is the Arduino UNO color coded. The green box is where the input cable is plugged in. This is how programs are sent to the Arduino. The input cable also provides power to the Arduino when plugged in.

The brown region is where the power cable is plugged in. This region is usually used when the input cable cannot provide enough power, or you are finished with your arduino project and would like to use a battery or wall outlet as your power source. This region is better for powering the Arduino than the input cable. Also note that Arduino cannot be programmed from this region and it is only for powering the Arduino.

The blue region contain the analog inputs and ground ports.

The orange region contains the analog ports.

The red region contains ports such as the 5V, 3.3V, and GND ports.

We encourage you to research more about the Arduino Hardware on the Arduino Website.

Software Section:

This is how a new Arduino sketch looks like. There are two functions, void setup() and void loop().

Code in the void setup runs one time when the Arduino Starts up. As its name implies, it is usually used for setup. In Arduino, pins are specified in the void setup.

Code in the void loop runs for as long as the Arduino is on.

We encorage you to check out th reference page on the Arduino Website.

Making a simple LED Program:

This should work on most Arduino, but is designed for Arduino UNO. We will be using the built in LED on the Arduino for this program.

Open the Arduino Program and enter the following code:

void setup() {
  // put your setup code here, to run once:
pinMode(13, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
}

Code Explanation:

pinMode(13, OUTPUT);
This code tells Arduino to set pin 13 as an output. The built in LED is attached to pin 13.
Since this code is in Void Setup(), it will only run once.

digitalWrite(13, HIGH);
This code tells Arduino to turn on the LED by sending power to pin 13.

delay(500);
This code tells Arduino to wait 500 milliseconds. The LED will stay on for 500 milliseconds.

digitalWrite(13, LOW);
This code tells arduino to stop supplying power to pin 13, turning off the LED.

delay(500);
This code tells Arduino to wait 500 milliseconds. The LED will stay off for 500 milliseconds.

Since the four lines of code above are in void loop, they will constantly repeat.

Now select Tools > Port and select your Arduino Board. Make sure the correct board is selected in Tools > Board and click the run button (looks like an arrow.

Now, the built in LED on your Arduino should blink. Optionally, you can connect your own LED to Pin 13 and GND. Please make sure to use the appropriate resistor for your LED to avoid breaking the LED.

Leave a Reply

Your email address will not be published. Required fields are marked *