Arduino

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Arduino is a small popular electronic machine that makes it very easy for people to make electronic things. It has two parts: a circuit board and a program that lets you tell the circuit board what to do. More than 300,000 Arduinos have been sold.[1]

The machine[change | change source]

The machine part is open source, which means that anybody can make their own version of an Arduino machine for free. An official Arduino costs around US$30.[2] The original Arduino is made by a company in Italy called "Smart Projects"[3] but other types of Arduino boards have been designed by SparkFun Electronics, an American company.[source?]

"Shields"[change | change source]

Sometimes, people will make other machines that go on top of an Arduino board and let the board do more things. These are called "Arduino shields". They can do different things, like let an Arduino machine connect to the internet, or add a touchscreen, or let an Arduino use GPS to figure out where it is. Shields can also combine and stack on top of each other.

Telling the Arduino what to do[change | change source]

Arduinos are programmed in C or C++, using a program also called Arduino. An example program to blink a light (LED) could look like this:

#define LED_PIN 13

void setup () {
  pinMode (LED_PIN, OUTPUT); // Enable pin 13 for digital output
}

void loop () {
  digitalWrite (LED_PIN, HIGH); // Turn on the LED
  delay (1000); // Wait one second (1000 milliseconds)
  digitalWrite (LED_PIN, LOW); // Turn off the LED
  delay (1000); // Wait one second
}

First, the code after "void setup() {" runs. This tells the arduino that pin 13 is going to be sending data out. Most Arduino boards have an LED attached to pin 13. Then, the code after the "void loop () {" runs. When it reaches the bottom, the code after the "void loop" runs again, until the Arduino is turned off. This code makes the Arduino tell the LED to turn on, wait a second, then turn off and wait another second. Since it repeats, this code will turn the LED on and off again and again.

References[change | change source]