Arduino

Submitted by Evan Boldt on Sat, 02/02/2013 - 17:52

Preface

Arduino is an awesome way to get into robotics. It is a very easy to use microcontroller that you program in C/C++. It does analog digital on/off input and output, reading of voltages, anolog output by Pulse Width Modulation (PWM) which is useful for hooking up motors, serial communication which is useful for communicating with sensors and other external devices.

A simple Arduino program example is blinking an LED. The code looks like this:

int led = 13; // Pin 13 has an LED connected on most Arduino boards.

void setup() {               // the setup routine runs once when you press reset:
  pinMode(led, OUTPUT);      // initialize the digital pin as an output.
}

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

Not too hard, right? We have lots of tutorials on how to do more advanced things with your Arduino.