Saturday, March 24, 2012

My Arduino adventures.

This is a small blog to help me keep track of my little Arduino projects. Most of them will small and simple as I'm learning as I go. For those of you who don't know, the Arduino is a SBC (single board computer) when can do practically anything you can imagine.

Image src: http://www.arduino.cc

There is an easy to use IDE (integrated development environment) that will compile, check and download your code to the Arduino board via its USB cable, its that simple!

Programming for the Arduino is based on C++ and with the help of its friendly API, makes programming a breeze:

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

This example code is in the public domain.
*/

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
This example will flash the onboard LED, it doesn't require any additional hardware.

The other great thing about the Arduino board is that it provides a large number of interfaces including PWM (pulse width modulation) and analogue inputs which makes it easy to add hardware to control or receive information from.

The are also inexpensive. I purchased an Arduino clone by Freetronics from Jaycar for $39.00. So if you like playing with software and hardware, go get yourself an Arduino board and have some fun!

No comments:

Post a Comment